SQL to Kysely Interface Generator

Convert SQL CREATE TABLE statements into type-safe Kysely TypeScript database interfaces with Generated and ColumnType.

At a glance

SQL to Kysely Interface Generator is a free developer utility that transforms SQL CREATE TABLE DDL statements into type-safe Kysely TypeScript database interfaces. It generates Database and Table interfaces with Generated<T> primary keys and ColumnType definitions 100% client-side in browser memory.

Universal Switcher:
From:
To:

100% Client-Side SQL to Kysely Interface Generator

Zero Server Uploads

Convert raw SQL CREATE TABLE DDL queries into type-safe Kysely TypeScript database interfaces with Generated and ColumnType directly in browser memory.

Local Sandbox
Presets:
0 chars
Speed: < 1 ms

Why Use This SQL to Kysely Interface Generator?

100% Client-Side Privacy: Your database schema and DDL queries never leave your local browser sandbox.
Type-Safe Kysely Schema: Generates both root Database and individual Table interfaces with Generated and ColumnType.
Accurate TypeScript Types: Maps primitives, UUIDs, decimals, and JSONB to string, number, Date, and Record<string, any>.
Multi-Table Batch Processing: Convert multiple CREATE TABLE DDL blocks into a complete database schema in one go.

How to Use SQL to Kysely Interface Generator

1

Input SQL DDL

Paste your SQL CREATE TABLE statements or upload a .sql file into the input editor.

2

Configure Options

Select ColumnType wrapping and import statements generation preferences.

3

Copy Kysely Interfaces

Copy or download the generated TypeScript Kysely database interfaces immediately.

SQL to Kysely Conversion example

Demonstrates converting an SQL CREATE TABLE statement into type-safe Kysely database and table interfaces.

SQL CREATE TABLE Statement Source
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
);
Generated Kysely TypeScript Interfaces Processed
import type { Generated, ColumnType } from 'kysely';

export interface Database {
  users: UsersTable;
}

export interface UsersTable {
  id: Generated<number>;
  name: string;
  created_at: ColumnType<Date, string | undefined, never>;
}

Technical Specifications & Engine Details

Technical specifications and engine details for SQL to Kysely Interface Generator
Specification Details
Supported Formats SQL, TEXT → 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 only by available device RAM.
Maintained by Pragyan Pahadi

100% Client-Side Privacy Guarantee

Your database DDL statements remain strictly on your local device. Zero data is transmitted to external servers.

Frequently Asked Questions

What is Kysely?
Kysely is a type-safe TypeScript SQL query builder that relies on pure TypeScript interfaces rather than decorators or code-generated runtime classes.
What does Generated<T> mean in Kysely?
Generated<T> marks a column that is automatically generated by the database upon insert (e.g. SERIAL, auto-increment, or default UUID) so it is optional when inserting rows.
Does SQL to Kysely Interface Generator require a database connection?
No. The conversion executes purely via in-browser SQL DDL parsing without requiring database connections or credentials.

Methodology

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

Last updated .