kysely-sql-js
v0.0.2
Published
Kysely dialect for sql.js
Downloads
52
Maintainers
Readme
kysely-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.