/kysely-sql-js

Kysely dialect for sql.js

Primary LanguageTypeScriptMIT LicenseMIT

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.