Labsco
prisma logo

prisma-database-setup-sqlite

✓ Official8

by prisma · part of prisma/cursor-plugin

SQLite Setup. Reference when using this Prisma feature.

🔥🔥🔥✓ VerifiedFreeAdvanced setup
🧩 One of 7 skills in the prisma/cursor-plugin package — works on its own, and pairs well with its siblings.

SQLite Setup. Reference when using this Prisma feature.

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by prisma

SQLite Setup. Reference when using this Prisma feature. npx skills add https://github.com/prisma/cursor-plugin --skill prisma-database-setup-sqlite Download ZIPGitHub8

3. Environment Variable

In .env:

Copy & paste — that's it
DATABASE_URL="file:./dev.db"

Connection String Format

Copy & paste — that's it
file:PATH
  • PATH: Relative path to the database file (from prisma/schema.prisma location usually, but in v7 check prisma.config.ts context). Usually relative to the schema file.

Driver Adapter (Prisma ORM 7 required)

Prisma ORM 7 uses the query compiler by default, so you must use a driver adapter.

Install adapter and driver:

Copy & paste — that's it
npm install @prisma/adapter-better-sqlite3 better-sqlite3

Instantiate Prisma Client with the adapter:

Copy & paste — that's it
import { PrismaClient } from '../generated/client'
import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3'

const adapter = new PrismaBetterSqlite3({
 url: process.env.DATABASE_URL ?? 'file:./dev.db',
})

const prisma = new PrismaClient({ adapter })

Using Driver Adapter (LibSQL / Turso)

For edge compatibility or Turso:

Install:

Copy & paste — that's it
npm install @prisma/adapter-libsql @libsql/client

Instantiate:

Copy & paste — that's it
import { PrismaClient } from '../generated/client'
import { PrismaLibSql } from '@prisma/adapter-libsql'

const adapter = new PrismaLibSql({
 url: process.env.TURSO_DATABASE_URL,
 authToken: process.env.TURSO_AUTH_TOKEN,
})
const prisma = new PrismaClient({ adapter })