mirror of
https://github.com/zenstackhq/zenstack
synced 2026-05-24 10:08:55 +00:00
| .. | ||
| src | ||
| test/getting-started | ||
| eslint.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsup.config.ts | ||
| vitest.config.ts | ||
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() }),
});