- Retrieve database credentials
- Connect to a remote Turso database
- Execute a query using SQL
Retrieve database credentials
You will need an existing database to continue. If you don’t have one, create one.Get the database URL:Get the database authentication token:Assign credentials to the environment variables inside
.env.You will want to store these as environment variables.
Connect to your database
- @tursodatabase/serverless
- @libsql/client
@libsql/client API, use the compat module: