Registry / database / prisma-adapter-sqlite

prisma-adapter-sqlite

JSON →
library1.0.0jsnpmunverified

Prisma driver adapter for the Node.js built-in SQLite module (node:sqlite), available as v1.0.0. This adapter enables Prisma Client to use the native Node.js SQLite driver instead of third-party libraries like better-sqlite3 or sql.js. It supports synchronous queries, connection pooling, and works with Prisma Migrate. Requires @prisma/client ^7.5.0. Key differentiator: zero external C++ dependencies and native Node.js integration, making it ideal for serverless environments and modern Node.js runtimes.

npm install prisma-adapter-sqlite
INSTALL
IMPORT
SIG · PRISMA-ADAPTER-SQL
P
prisma-adapter-sqlite
databasejavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PrismaSQLite
import { PrismaSQLite } from 'prisma-adapter-sqlite'
import PrismaSQLite from 'prisma-adapter-sqlite'
The adapter class is a named export, not a default export.
PrismaClient
import { PrismaClient } from '@prisma/client'
Standard Prisma Client import, used together with the adapter.
PrismaSQLiteOptions
import type { PrismaSQLiteOptions } from 'prisma-adapter-sqlite'
import { PrismaSQLiteOptions } from 'prisma-adapter-sqlite'
This is a TypeScript type and should be imported as a type.

Instantiate PrismaSQLite adapter with a SQLite URL and pass it to PrismaClient for database operations.

import { PrismaClient } from '@prisma/client'; import { PrismaSQLite } from 'prisma-adapter-sqlite'; const adapter = new PrismaSQLite({ url: 'file:./prisma/dev.db', }); const prisma = new PrismaClient({ adapter, }); async function main() { const users = await prisma.user.findMany(); console.log(users); } main();
Debug
Known issues
gotchaThe adapter requires Node.js >=18.19.0 (built-in node:sqlite). Older versions will throw ERR_MODULE_NOT_FOUND.
fix
Upgrade Node.js to >=18.19.0 or use a different SQLite adapter like @prisma/adapter-better-sqlite3.
affects: >=1.0.0
gotchaPrismaSQLite is synchronous by design. Do not use it in async contexts expecting callbacks — operations block the event loop.
fix
Use the adapter only in synchronous or worker-thread contexts. For async SQLite, consider @prisma/adapter-libsql.
affects: >=1.0.0
breakingPrismaSQLite constructor requires an options object with a 'url' property. Passing a path string directly will throw a TypeError.
fix
Wrap the path in an object: new PrismaSQLite({ url: 'file:./path/to/db' })
affects: >=1.0.0
deprecatedPrismaSQLiteOptions type may change in future minor versions. It is currently stable but not frozen.
fix
Check the changelog before upgrading; stick to documented options.
affects: >=1.0.0
gotchaPrisma Migrate does not support in-memory databases (':memory:') with this adapter. Use a file path instead.
fix
Specify a file path for the SQLite database, e.g., 'file:./dev.db'.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'prisma-adapter-sqlite'
Package not installed or not in node_modules.
fix
Run `npm install prisma-adapter-sqlite` or add it to your package.json.
TypeError: Class extends value undefined is not a constructor or null
Using wrong import pattern (default instead of named export).
fix
Use `import { PrismaSQLite } from 'prisma-adapter-sqlite'` instead of a default import.
PrismaClientValidationError: Invalid adapter provided. Expected an instance of PrismaAdapter.
Passing a plain object or uninitialized adapter to PrismaClient.
fix
Instantiate PrismaSQLite before creating PrismaClient: `const adapter = new PrismaSQLite({ url: '...' });`
Error: Cannot find module 'node:sqlite'
Node.js version too old; node:sqlite is only available in Node.js >=18.19.0.
fix
Upgrade Node.js to >=18.19.0 or use a polyfill like @prisma/adapter-better-sqlite3.
Error: SQLITE_ERROR: no such table: User
Prisma Migrate not run or schema not deployed.
fix
Run `npx prisma migrate dev` or `npx prisma db push` to create the database schema.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
@prisma/clientrequiredPeer dependency required by Prisma adapter protocol
Agent activity
4 hits · last 30 days
node
4
Resources
prisma-adapter-sqlite — npm install prisma-adapter-sqlite · libregistry