Prisma + Turso
Configure Prisma to work with your Turso database
Prerequisites
Before you start, make sure you:
- Install the Turso CLI
- Sign up or login to Turso
- Prisma versions 5.4.2 and later
Install the libSQL SDK and its Prisma driver
Retrieve database credentials
Get the database URL:
Get the database authentication token:
Assign credentials to the environment variables inside .env
.
Enable the `driverAdapters` preview feature flag:
Generate Prisma client
Update your Prisma Client Instance
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 database
Then, 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.
Query
Was this page helpful?