Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/betarixm/kysely-sql-js
Kysely dialect for sql.js
https://github.com/betarixm/kysely-sql-js
kysely sql-js sqlite
Last synced: about 13 hours ago
JSON representation
Kysely dialect for sql.js
- Host: GitHub
- URL: https://github.com/betarixm/kysely-sql-js
- Owner: betarixm
- License: mit
- Created: 2024-06-10T16:05:29.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-12T13:51:04.000Z (5 months ago)
- Last Synced: 2024-10-31T18:20:16.283Z (18 days ago)
- Topics: kysely, sql-js, sqlite
- Language: TypeScript
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kysely-sql-js
![Powered by TypeScript](https://img.shields.io/badge/powered%20by-typescript-blue.svg)
[Kysely](https://github.com/koskimas/kysely) dialect for [sql.js](https://sql.js.org/#/).
This dialect is just for testing purposes. It's not recommended to use it in production.
## Usage
```ts
import { type GeneratedAlways, Kysely } from "kysely";
import initSqlJs from "sql.js";import { SqlJsDialect } from "kysely-sql-js";
interface Database {
person: {
id: GeneratedAlways;
first_name: string | null;
last_name: string | null;
age: number;
};
}const SqlJsStatic = await initSqlJs();
export const db = new Kysely({
dialect: new SqlJsDialect({ sqlJs: new SqlJsStatic.Database() }),
});
```Check detailed example from [tests/getting-started](tests/getting-started).