Skip to main content
Use tc sql when your app stores structured data in a TinyCloud space and you want SQLite semantics from the terminal.

Core commands

Targeting

--db picks the database name inside the current space. --space targets a different owned space.

Parameters

Pass bind parameters as a JSON array.

Outputs

  • query prints a table in the terminal and JSON with --json
  • execute returns changes and lastInsertRowId
  • export writes a .db file locally
  • copy moves rows between databases and can run as a dry run

Practical order

  1. Create or host the target space
  2. Run tc sql execute to materialize the schema
  3. Query with tc sql query
  4. Export only when you need a local copy
If a SQL command fails because the target space is not hosted, host the owned space first and retry the command.