zenstack/packages/dialects/sql.js
2025-11-09 20:54:31 -08:00
..
src feat: add sql.js dialect (#134) 2025-08-04 17:11:42 +08:00
test/getting-started feat: add sql.js dialect (#134) 2025-08-04 17:11:42 +08:00
eslint.config.js feat: add sql.js dialect (#134) 2025-08-04 17:11:42 +08:00
package.json chore: bump version 3.0.0-beta.21 (#388) 2025-11-09 20:54:31 -08:00
README.md readme update (#138) 2025-08-04 17:54:44 +08:00
tsconfig.json feat: cli plugin support (#181) 2025-08-17 16:35:07 +08:00
tsup.config.ts feat: add sql.js dialect (#134) 2025-08-04 17:11:42 +08:00
vitest.config.ts feat: add sql.js dialect (#134) 2025-08-04 17:11:42 +08:00

Forked from https://github.com/betarixm/kysely-sql-js

Usage

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

import { SqlJsDialect } from '@zenstackhq/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() }),
});