Skip to content

betarixm/kysely-sql-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Kysely dialect for sql.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published