Build locally using SQLite, libSQL Server or Turso.
Developers can build locally with Turso using either of the following methods:
You can always dump your production database and use it locally for development:
Create a dump using the Turso CLI
Create SQLite file from dump
Connect to SQLite file
You can use any of the methods below with the local.db
file, or you can use a new file name if you prefer to create a database from scratch.
There are a few things to keep in mind when using SQLite for local development:
When working with an SDK, you can pass it a file:
URL to connect to a SQLite database file instead of a remote Turso database:
You don’t need to provide an authToken
in development.
It’s recommended to use environment variables for both url
and authToken
for a seamless developer experience.
If you’re using libSQL specific features like extensions, you should use the Turso CLI:
This will start a local libSQL server and create a database for you. You can then connect to it using the url
option in your SDK:
Changes will be lost when you stop the server.
If you want to persist changes, or use a production dump, you can pass the --db-file
flag with the name of the SQLite file:
If you already have a database created with Turso, you can use that same one in development by passing the url
option to your SDK.
During development you can easily connect to a SQLite, libSQL, or Turso database using one of the tools below:
Build locally using SQLite, libSQL Server or Turso.
Developers can build locally with Turso using either of the following methods:
You can always dump your production database and use it locally for development:
Create a dump using the Turso CLI
Create SQLite file from dump
Connect to SQLite file
You can use any of the methods below with the local.db
file, or you can use a new file name if you prefer to create a database from scratch.
There are a few things to keep in mind when using SQLite for local development:
When working with an SDK, you can pass it a file:
URL to connect to a SQLite database file instead of a remote Turso database:
You don’t need to provide an authToken
in development.
It’s recommended to use environment variables for both url
and authToken
for a seamless developer experience.
If you’re using libSQL specific features like extensions, you should use the Turso CLI:
This will start a local libSQL server and create a database for you. You can then connect to it using the url
option in your SDK:
Changes will be lost when you stop the server.
If you want to persist changes, or use a production dump, you can pass the --db-file
flag with the name of the SQLite file:
If you already have a database created with Turso, you can use that same one in development by passing the url
option to your SDK.
During development you can easily connect to a SQLite, libSQL, or Turso database using one of the tools below: