
prisma-database-setup-sqlite
✓ Official★ 8by prisma · part of prisma/cursor-plugin
SQLite Setup. Reference when using this Prisma feature.
SQLite Setup. Reference when using this Prisma feature.
Inspect the full instructions your agent will receiveExpandCollapse
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:
DATABASE_URL="file:./dev.db"
Connection String Format
file:PATH
- PATH: Relative path to the database file (from
prisma/schema.prismalocation usually, but in v7 checkprisma.config.tscontext). 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:
npm install @prisma/adapter-better-sqlite3 better-sqlite3
Instantiate Prisma Client with the adapter:
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:
npm install @prisma/adapter-libsql @libsql/client
Instantiate:
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 })
npm install @prisma/adapter-better-sqlite3 better-sqlite3Run this in your project — your agent picks the skill up automatically.
SQLite Setup
Configure Prisma with SQLite.
Prerequisites
- None (file-based)
1. Schema Configuration
In prisma/schema.prisma:
datasource db {
provider = "sqlite"
}
generator client {
provider = "prisma-client"
output = "../generated"
}
2. Config Configuration (v7)
In prisma.config.ts:
import { defineConfig, env } from 'prisma/config'
export default defineConfig({
schema: 'prisma/schema.prisma',
datasource: {
url: env('DATABASE_URL'),
},
})
Limitations
-
No Enums: SQLite doesn't support enums (Prisma polyfills them or treats as String).
-
No Scalar Lists:
String[]is not supported directly. -
Concurrency: Write operations lock the file.
Common Issues
"Database file not found"
Ensure the path in DATABASE_URL is correct relative to where Prisma is running or the schema file. file:./dev.db creates it next to schema.