- Retrieve database credentials
- Install the JavaScript libSQL client
- 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 database URL
Get database URL
Create database auth token
Create database auth token
You will want to store these as environment variables.
Initialize a new client
Next add your database URL and auth token:
You can also connect to a local SQLite file by passing
file: instead of a URL when using Node.js, learn
more.