
Prerequisites
Before you start, make sure you:- Install the Turso CLI
- Sign up or login to Turso
- Prisma versions 5.4.2 and later
1
Install the libSQL SDK and its Prisma driver
2
Retrieve database credentials
Get the database URL:Get the database authentication token:Assign credentials to the environment variables inside
.env
.3
Enable the `driverAdapters` preview feature flag:
prisma/schema.prisma
4
Generate Prisma client
5
Update your Prisma Client Instance
6
Database Migrations
Prisma Migrate and Introspection workflows are currently not supported when working with Turso — learn more.First, generate a migration file using prisma migrate dev against a local SQLite databaseThen, apply the migration to your Turso database using the Turso’s CLI
Replace
20230922132717_init
with the name of your migration created from the npx prisma migrate dev
command.7
Query