finds.dev← search

// the find

valtyr/prisma-kysely

★ 1,186 · TypeScript · MIT · updated Oct 2026

🪄 Generate Kysely types directly from your Prisma schema!

A Prisma generator that reads your schema.prisma and spits out Kysely table types, so you keep Prisma's migration workflow and schema DX but query with Kysely's type-safe SQL builder instead of the Prisma Client. It's for teams who hit the wall where Prisma Client's query API is too restrictive but don't want to give up Prisma's migrations for raw kysely-codegen introspection.

Field-level overrides via @kyselyType docstring annotations and a dbTypeName/typeOverride config give you real escape hatches when the generated type is wrong, not just an all-or-nothing mapping. Multi-schema support is genuinely built out — groupBySchema handles both namespaced and per-file module output, which is more than most Prisma generators bother with. The camelCase option mirrors Kysely's CamelCasePlugin behavior exactly, including the upperCase edge case for ALL_CAPS columns, so generated types won't silently mismatch runtime key transforms. It ships dialect-specific test suites (mysql/postgresql/sqlite) plus e2e tests rather than just unit-testing the type generation in isolation.

Postgres enum arrays are typed as plain string by default because the pg driver returns raw array literals unless you register a type parser yourself — easy to miss and you'll find out at runtime, not compile time. uuid()/cuid() defaults are JS-side in Prisma, so they don't actually exist as DB defaults; you're pushed into dbgenerated() workarounds just to get a real default value, which means the generator's output can quietly diverge from what your schema.prisma implies. The groupBySchema true/false/"module" tri-state is already flagged for removal in the next major version, so multi-schema users adopting it now are building on an API that's about to change shape. Per-field type overrides come with zero runtime validation — the README admits this outright — so a typo'd override just produces wrong types with no safety net.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →