ProvenPin Install

Prisma 7 + SQLite via better-sqlite3 adapter: working versions (tested 2026-10-15)

Prisma Client 7 with the better-sqlite3 driver adapter, schema push and relational queries on a local SQLite file.

passed1 passed · 0 failed2026-10-15 11:37 UTC
Status
passed
Last passed
2026-10-15 11:37 UTC
Tests
1 / 1
Language
TypeScript
Runtime
node v22.23.3
pinned versions5
@prisma/client@7.10.0@prisma/adapter-better-sqlite3@7.10.0tsx@4.23.15@types/node@24.19.2prisma@7.10.0
run it
npm install --no-audit --no-fund && npx prisma db push && npx prisma generate
npm test
test environment
node v22.23.3
linux 6.17.0-1022-azure
x64
runner: github-actions 38728226240

The code

Exactly the files that passed. Your agent can pull them with get_recipe("prisma-sqlite-adapter") (install), or see them on GitHub.

package.json
{
  "name": "prisma-sqlite-adapter",
  "private": true,
  "type": "module",
  "scripts": {
    "test": "node --import tsx --test test/*.test.ts"
  },
  "dependencies": {
    "@prisma/client": "7.10.0",
    "@prisma/adapter-better-sqlite3": "7.10.0"
  },
  "devDependencies": {
    "tsx": "4.23.15",
    "@types/node": "24.19.2",
    "prisma": "7.10.0"
  }
}
prisma/schema.prisma
generator client {
  provider = "prisma-client"
  output   = "../src/generated/prisma"
}

datasource db {
  provider = "sqlite"
}

model User {
  id    Int    @id @default(autoincrement())
  email String @unique
  posts Post[]
}

model Post {
  id       Int    @id @default(autoincrement())
  title    String
  author   User   @relation(fields: [authorId], references: [id])
  authorId Int
}
prisma.config.ts
import { defineConfig } from "prisma/config";
export default defineConfig({
  schema: "prisma/schema.prisma",
  datasource: { url: "file:./test.db" },
});
src/db.ts
import { PrismaBetterSqlite3 } from "@prisma/adapter-better-sqlite3";
import { PrismaClient } from "./generated/prisma/client.ts";

export function createClient(url = "file:./test.db") {
  return new PrismaClient({ adapter: new PrismaBetterSqlite3({ url }) });
}
test/db.test.ts
import { test } from "node:test";
import assert from "node:assert/strict";
import { createClient } from "../src/db.ts";

test("create user with posts and query relation", async () => {
  const prisma = createClient();
  await prisma.post.deleteMany();
  await prisma.user.deleteMany();
  await prisma.user.create({ data: { email: "a@example.com", posts: { create: [{ title: "one" }, { title: "two" }] } } });
  const user = await prisma.user.findUnique({ where: { email: "a@example.com" }, include: { posts: true } });
  assert.equal(user?.posts.length, 2);
  await prisma.$disconnect();
});

Connect to ProvenPin

Add the free MCP server so your agent can pull this recipe and others like it. Same setup as the docs.

terminal
claude mcp add --transport http provenpin https://mcp.provenpin.com/mcp

Any other MCP client: Streamable HTTP at https://mcp.provenpin.com/mcp. No API key, no signup.