Databases
Create and query standalone Buildspace databases from the terminal.
buildspace db manages standalone databases — SQLite databases owned by your organization rather than by a project. See Standalone Databases for the full feature.
List
buildspace db list
buildspace db list --jsonShows each database's slug, name, status, connection URL, and storage, plus how much of your quota is used.
Create
buildspace db create "Scratch data"
buildspace db create "Analytics" --description "Ad-hoc reporting tables"Prints the connection URL and an auth token. The token is shown once — it is hashed on save and cannot be recovered.
Show
buildspace db show scratch-dataPrints usage plus the token inventory (id, prefix, access level, state).
Run SQL
buildspace db shell scratch-data --sql "select count(*) from users"
buildspace db shell scratch-data --write --sql "delete from sessions"
cat migration.sql | buildspace db shell scratch-data --writeQueries are read-only unless you pass --write. They run server-side under the same guardrails as the Studio console: row caps, a statement timeout, and an org-ownership check.
Every command accepts a database's slug or its UUID.
Tokens
buildspace db token list scratch-data
buildspace db token create scratch-data --label analytics --read-only
buildspace db token revoke scratch-data <tokenId>Mint one token per consumer so you can revoke narrowly. To invalidate every token at once, rotate credentials from the database page in Creator Studio.
Delete
buildspace db delete scratch-data --yesDestroys the database and all of its data. --yes is required — there is no undo.
Options
| Flag | Description |
|---|---|
--description <text> | Description stored with a new database |
--label <text> | Label for a new token |
--read-only | Mint a read-only token |
--sql <statement> | SQL to run (shell); omit to read stdin |
--write | Allow write statements in shell |
--yes | Skip the delete confirmation |
--json | Machine-readable output |