This dialect is just for testing purposes. It's not recommended to use it in production.
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.