mcpbeat Sign in

Prisma Database Setup Sqlite Skill for Cursor

SQLite Setup. Reference when using this Prisma feature.

651 tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
8
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-database-setup-sqlite

What comes with it

108 bytes besides the instruction
metadata.json

The instruction itself

11 sections, as written by the author

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'),
  },
})

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.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:
   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 })

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.

How to use it

Copy the folder

Take prisma/prisma-database-setup-sqlite from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npm. Without those the skill loads but fails at the first command.