Prisma Schema to Kysely Interface Generator

Convert Prisma schema models and enums into type-safe Kysely TypeScript interfaces with Generated and ColumnType annotations.

At a glance

Prisma Schema to Kysely Interface Generator is a free developer utility that transforms Prisma schema models into type-safe Kysely TypeScript table interfaces. It accurately maps scalar types, enums, nullable columns, and Generated attributes 100% client-side in browser memory.

Universal Switcher:
From:
To:

100% Client-Side Prisma to Kysely Interface Generator

Zero Server Uploads

Transform Prisma schema models and enums into type-safe Kysely TypeScript table interfaces with Generated annotations directly in your browser.

Local Sandbox
Presets:
0 models

Kysely Generated Annotations

Accurately transforms Prisma @default(autoincrement()), @default(uuid()), @default(now()), and @updatedAt attributes into Kysely Generated<T> types.

Relation Field Filtering

Automatically filters out virtual Prisma ORM relation fields (posts Post[], user User @relation(...)), leaving only concrete database columns in table interfaces.

100% In-Browser Privacy

All parsing, AST analysis, and TypeScript interface generation runs locally in client-side JavaScript memory with zero network requests and zero telemetry.

Copied to clipboard!

Why Use This Prisma Schema to Kysely Interface Generator?

100% Client-Side Privacy: Your schema definitions never leave your device or touch remote servers.
Kysely Generated Annotations: Correctly annotates autoincrementing IDs, default timestamps, UUIDs, and cuids with Generated<T>.
Relation Field Filtering: Strips Prisma ORM virtual relation fields, leaving only concrete database columns.
Enum to TypeScript Unions: Converts Prisma enums into clean exported TypeScript string union types.
Root Database Interface: Generates the master Database interface with type mappings for immediate Kysely instance instantiation.

How to Use Prisma Schema to Kysely Interface Generator

1

Input Prisma Schema

Paste your Prisma Schema Language (PSL) models and enums or load a built-in preset.

2

Configure Generator Options

Customize table suffix (Table, Row, none), DateTime representation (Date or string), and field casing.

3

Copy or Download Kysely Types

Copy the generated Kysely TypeScript interfaces to your clipboard or download as database.types.ts.

Prisma Schema to Kysely Interface example

Demonstrates converting a Prisma User model into a Kysely UserTable interface with Generated serial ID and default timestamp, nullable name, and root Database interface.

Sample Prisma Model Source
model User {
  id        Int      @id @default(autoincrement())
  email     String   @unique
  name      String?
  createdAt DateTime @default(now())
}
Generated Kysely Interfaces Processed
import type { Generated } from 'kysely';

export interface UserTable {
  id: Generated<number>;
  email: string;
  name: string | null;
  createdAt: Generated<Date>;
}

export interface Database {
  user: UserTable;
}

Technical Specifications & Engine Details

Technical specifications and engine details for Prisma Schema to Kysely Interface Generator
Specification Details
Supported Formats TEXT, PRISMA → TYPESCRIPT, 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.
Maintained by Pragyan Pahadi

100% Client-Side Privacy Guarantee

Your files remain strictly on your local device. Zero data is transmitted to external servers.

Frequently Asked Questions

How are relation fields handled in Prisma to Kysely conversion?
Virtual relation fields (e.g. posts Post[] or user User @relation(...)) are filtered out because Kysely operates directly on database table columns rather than ORM navigation properties. Foreign key scalar columns (like authorId Int) are preserved.
Why are some column types wrapped in Generated<T>?
In Kysely, Generated<T> tells TypeScript that a column has a database-level default (such as an autoincrementing sequence, uuid, or now() timestamp), making the column optional during INSERT queries while strictly typed during SELECT queries.
Is my Prisma schema kept private?
Yes. All parsing and code generation takes place 100% locally in your browser memory. No schema data is ever transmitted to any external server.

Methodology

This tool runs entirely in your browser. The example above shows a representative input and the result it produces.

Last updated .