db
db shell
You can connect directly to a Turso database by using the following command:
Flags
Flag | Description |
---|---|
--attach <database-name> | List of database names with attach claim to be added to the token. |
--instance <instance> | Connect to the specified database instance. |
--location <location-code> | Connect to the database at the specified location. |
--proxy <url> | The proxy to use when connecting to the database. |
Examples
Execute SQL
You can execute SQL directly against a database using the shell:
Database dump
You can dump the contents of a Turso database using the following command:
The .dump
can be used to rebuild a database and doesn’t contain any libSQL or SQLite internal tables.
Load from dump
You can load a dump file into a new database using the following command:
Shell with libSQL server
If you’re using turso dev
locally, you can use the shell by providing the URL to your database:
Connect using a specific database location
You can connect to a database in a specific location using the --location
flag: