Registry / database / prisma-effect-kysely

prisma-effect-kysely

JSON →
library5.10.0jsnpmunverified

A Prisma generator (v5.10.0, maintained) that produces Effect Schema types from Prisma schema, designed for use with the Kysely query builder. Bridges Prisma's modeling with Effect-TS's type-safe schema validation, enabling compile-time type safety across database queries and effects. Updates roughly monthly; alternative to manual type generation or Zod-based approaches. Requires Node >=20, Bun >=1.0, Effect ^3.19.14, Kysely ^0.28.9.

npm install prisma-effect-kysely
INSTALL
IMPORT
SIG · PRISMA-EFFECT-KYSE
P
prisma-effect-kysely
databasejavascriptv5.10.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.

PrismaEffectKyselyGenerator
import { PrismaEffectKyselyGenerator } from 'prisma-effect-kysely'
const PrismaEffectKyselyGenerator = require('prisma-effect-kysely')
This package is ESM-only; CommonJS require will fail.
GeneratedSchema
import { GeneratedSchema } from './generated/prisma-schema'
import { GeneratedSchema } from 'prisma-effect-kysely'
The type is generated in your project, not exported from the package.
Effect
import { Effect } from 'effect'
import { Effect } from 'prisma-effect-kysely'
Effect library is a peer dependency, not re-exported by this package.

Shows setup: add generator to Prisma schema, run generate, then use generated Effect Schema types.

// Add generator to Prisma schema // schema.prisma: // generator effect { // provider = "prisma-effect-kysely" // output = "../src/generated" // } // After running `npx prisma generate`, use generated types: import { UserSchema } from './generated/prisma-schema'; import { Effect } from 'effect'; const program = Effect.sync(() => { const user = UserSchema.decode({ id: 1, name: 'Alice' }); return user; }); Effect.runPromise(program).then(console.log);
Debug
Known issues
breakingRequires Node >=20 and Bun >=1.0. Older versions won't work.
fix
Upgrade Node to >=20 or Bun to >=1.0.
affects: >=5.0
breakingPeer dependencies effect and kysely must be installed separately. Versions must satisfy ^3.19.14 and ^0.28.9 respectively.
fix
Run `npm install effect@^3.19.14 kysely@^0.28.9`.
affects: >=5.0
gotchaGenerated output file location defaults to `node_modules/.prisma/client` unless `output` is specified in generator config.
fix
Set `output = "../src/generated"` in the generator block to control location.
affects: >=5.0
gotchaTypeScript `strict` mode is required for full type safety.
fix
Enable `"strict": true` in tsconfig.json.
affects: >=5.0
Errors
Common errors & fixes
Error: Cannot find module 'prisma-effect-kysely' require() of ES Module
Package is ESM-only; CommonJS require is unsupported.
fix
Use import syntax and ensure your project is ESM ("type": "module" in package.json).
Error: Cannot find module 'effect'
Peer dependency not installed.
fix
Run `npm install effect@^3.19.14`.
Error: Generator 'effect' not found or failed to load.
Missing or invalid generator configuration in Prisma schema.
fix
Ensure `provider = "prisma-effect-kysely"` is correct and the package is installed.
Upgrade
Version history
5.10.0latest on npm
Audit
Dependencies
effectrequiredPeer dependency for Effect Schema and related runtime
kyselyrequiredPeer dependency for Kysely query builder types
Agent activity
11 hits · last 30 days
node
10
Resources
prisma-effect-kysely — npm install prisma-effect-kysely · libregistry