@syncular/dialect-bun-sqlite 0.0.6-73 → 0.0.6-79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -17
package/README.md
CHANGED
|
@@ -11,9 +11,13 @@ npm install @syncular/dialect-bun-sqlite
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
import {
|
|
14
|
+
import { createDatabase } from '@syncular/core';
|
|
15
|
+
import { createBunSqliteDialect } from '@syncular/dialect-bun-sqlite';
|
|
15
16
|
|
|
16
|
-
const db =
|
|
17
|
+
const db = createDatabase<MyDb>({
|
|
18
|
+
dialect: createBunSqliteDialect({ path: './app.sqlite' }),
|
|
19
|
+
family: 'sqlite',
|
|
20
|
+
});
|
|
17
21
|
```
|
|
18
22
|
|
|
19
23
|
## Documentation
|
package/dist/index.d.ts
CHANGED
|
@@ -3,21 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides a Kysely dialect for bun:sqlite.
|
|
5
5
|
*/
|
|
6
|
-
import { Kysely } from 'kysely';
|
|
7
6
|
import { BunSqliteDialect } from 'kysely-bun-sqlite';
|
|
8
7
|
export interface BunSqliteOptions {
|
|
9
8
|
/** Path to SQLite database file, or ':memory:' for in-memory */
|
|
10
9
|
path: string;
|
|
11
10
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Create a Kysely instance with Bun SQLite dialect.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* const db = createBunSqliteDb<MyDb>({ path: ':memory:' });
|
|
17
|
-
* // or
|
|
18
|
-
* const db = createBunSqliteDb<MyDb>({ path: './data.db' });
|
|
19
|
-
*/
|
|
20
|
-
export declare function createBunSqliteDb<T>(options: BunSqliteOptions): Kysely<T>;
|
|
21
11
|
/**
|
|
22
12
|
* Create the Bun SQLite dialect directly.
|
|
23
13
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,GACxB,gBAAgB,CAGlB"}
|
package/dist/index.js
CHANGED
|
@@ -4,22 +4,7 @@
|
|
|
4
4
|
* Provides a Kysely dialect for bun:sqlite.
|
|
5
5
|
*/
|
|
6
6
|
import { Database } from 'bun:sqlite';
|
|
7
|
-
import { Kysely } from 'kysely';
|
|
8
7
|
import { BunSqliteDialect } from 'kysely-bun-sqlite';
|
|
9
|
-
/**
|
|
10
|
-
* Create a Kysely instance with Bun SQLite dialect.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* const db = createBunSqliteDb<MyDb>({ path: ':memory:' });
|
|
14
|
-
* // or
|
|
15
|
-
* const db = createBunSqliteDb<MyDb>({ path: './data.db' });
|
|
16
|
-
*/
|
|
17
|
-
export function createBunSqliteDb(options) {
|
|
18
|
-
const database = new Database(options.path);
|
|
19
|
-
return new Kysely({
|
|
20
|
-
dialect: new BunSqliteDialect({ database }),
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
8
|
/**
|
|
24
9
|
* Create the Bun SQLite dialect directly.
|
|
25
10
|
*
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOrD;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAyB,EACP;IAClB,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,IAAI,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CAC3C"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Database } from 'bun:sqlite';
|
|
8
|
-
import { Kysely } from 'kysely';
|
|
9
8
|
import { BunSqliteDialect } from 'kysely-bun-sqlite';
|
|
10
9
|
|
|
11
10
|
export interface BunSqliteOptions {
|
|
@@ -13,22 +12,6 @@ export interface BunSqliteOptions {
|
|
|
13
12
|
path: string;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
/**
|
|
17
|
-
* Create a Kysely instance with Bun SQLite dialect.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const db = createBunSqliteDb<MyDb>({ path: ':memory:' });
|
|
21
|
-
* // or
|
|
22
|
-
* const db = createBunSqliteDb<MyDb>({ path: './data.db' });
|
|
23
|
-
*/
|
|
24
|
-
export function createBunSqliteDb<T>(options: BunSqliteOptions): Kysely<T> {
|
|
25
|
-
const database = new Database(options.path);
|
|
26
|
-
|
|
27
|
-
return new Kysely<T>({
|
|
28
|
-
dialect: new BunSqliteDialect({ database }),
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
15
|
/**
|
|
33
16
|
* Create the Bun SQLite dialect directly.
|
|
34
17
|
*
|