Skip to main content
This plugin allows services to connect to a Turso database. Turso is an edge-hosted distributed database based on libSQL, a SQLite fork.

Usage

IMPORTANT: Currently Shuttle isnโ€™t able to provision a Turso database for you (yet). This means you will have to create an account on their website and follow the few steps required to create a database and create a token to access it.
Add shuttle-turso and libsql to the dependencies for your service by running cargo add shuttle-turso libsql. This resource will be provided by adding the shuttle_turso::Turso attribute to your Shuttle main decorated function. It returns a libsql::Database. When running locally it will instantiate a local SQLite database of the name of your service instead of connecting to your edge database. If you want to connect to a remote database when running locally, you can specify the local_addr parameter. In that case, the token will be read from your Secrets.dev.toml file.

Parameters

Example

In the case of an Axum server, your main function will look like this: