Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 824 Bytes

README.md

File metadata and controls

33 lines (23 loc) · 824 Bytes

kysely-sql-js

Powered by TypeScript

Kysely dialect for sql.js.

This dialect is just for testing purposes. It's not recommended to use it in production.

Usage

import { type GeneratedAlways, Kysely } from "kysely";
import initSqlJs from "sql.js";

import { SqlJsDialect } from "kysely-sql-js";

interface Database {
  person: {
    id: GeneratedAlways<number>;
    first_name: string | null;
    last_name: string | null;
    age: number;
  };
}

const SqlJsStatic = await initSqlJs();

export const db = new Kysely<Database>({
  dialect: new SqlJsDialect({ sqlJs: new SqlJsStatic.Database() }),
});

Check detailed example from tests/getting-started.