Kysely TypeScript Interfaces to Prisma Model Converter
Convert type-safe Kysely TypeScript interfaces into canonical Prisma schema models and enums with automatic primary key and default mapping.
At a glance
Kysely to Prisma Model Converter is a free developer utility that transforms Kysely TypeScript table interfaces and union types into canonical Prisma schema models and enums. It unwraps Generated and ColumnType modifiers and maps scalar types 100% client-side in browser memory.
100% Client-Side Kysely to Prisma Model Converter
Zero Server UploadsConvert type-safe Kysely TypeScript table interfaces into canonical Prisma schema models and enums with automatic primary key and default unwrapping directly in your browser.
Kysely Wrapper Unwrapping
Accurately unwraps Kysely Generated<T> and ColumnType<S, I, U> wrappers into Prisma attributes like @default(autoincrement()), @default(now()), and @updatedAt.
Database Interface Mapping
Reads the root export interface Database table mappings, automatically attaching Prisma @@map("table_name") directives when database names differ from PascalCase models.
100% In-Browser Privacy
All parsing, AST analysis, and Prisma schema generation runs locally in your browser memory with zero network requests and zero server uploads.
Why Use This Kysely TypeScript Interfaces to Prisma Model Converter?
How to Use Kysely TypeScript Interfaces to Prisma Model Converter
Input Kysely Interfaces
Paste your Kysely TypeScript database interfaces and union types or load a preset.
Configure Output Options
Select your target datasource provider, ID strategy (autoincrement, uuid, cuid), and suffix stripping.
Copy or Download Prisma Schema
Copy the converted Prisma schema directly to your clipboard or download as schema.prisma.
Kysely to Prisma Model example
Demonstrates converting a Kysely UserTable interface into a canonical Prisma model with autoincrement primary key, nullable name, and default timestamp.
import type { Generated } from 'kysely';
export interface UserTable {
id: Generated<number>;
email: string;
name: string | null;
createdAt: Generated<Date>;
}
model User {
id Int @id @default(autoincrement())
email String
name String?
createdAt DateTime @default(now())
}
Technical Specifications & Engine Details
| Specification | Details |
|---|---|
| Supported Formats | TYPESCRIPT, TEXT → PRISMA, TEXT |
| Execution Mode | 100% Client-Side In-Browser (client) |
| Browser Requirements | Modern browser with JavaScript enabled. |
| Performance Constraints | Runs 100% client-side in browser memory. Performance and file limits are bounded by available local device RAM. |
100% Client-Side Privacy Guarantee
Your files remain strictly on your local device. Zero data is transmitted to external servers.
Frequently Asked Questions
How does the converter handle Kysely Generated<T> wrappers?
Are TypeScript union types supported as Prisma enums?
Is my TypeScript code processed privately?
Methodology
This tool runs entirely in your browser. The example above shows a representative input and the result it produces.
Last updated .