@syncular/dialect-better-sqlite3 0.0.2-128 → 0.0.2-135
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 +1 -1
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/src/index.ts +3 -10
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @syncular/dialect-better-sqlite3 - better-sqlite3 dialect for sync
|
|
3
3
|
*
|
|
4
|
-
* Provides a Kysely dialect for better-sqlite3 (Node.js)
|
|
5
|
-
* for automatic JSON serialization/deserialization.
|
|
4
|
+
* Provides a Kysely dialect for better-sqlite3 (Node.js).
|
|
6
5
|
* SQLite-compatible — use with @syncular/server-dialect-sqlite.
|
|
7
6
|
*/
|
|
8
|
-
import { SerializePlugin } from '@syncular/core';
|
|
9
7
|
import type { Database as BetterSqlite3Database } from 'better-sqlite3';
|
|
10
8
|
import { Kysely, SqliteDialect } from 'kysely';
|
|
11
9
|
export interface BetterSqlite3PathOptions {
|
|
@@ -18,7 +16,7 @@ export interface BetterSqlite3InstanceOptions {
|
|
|
18
16
|
}
|
|
19
17
|
export type BetterSqlite3Options = BetterSqlite3PathOptions | BetterSqlite3InstanceOptions;
|
|
20
18
|
/**
|
|
21
|
-
* Create a Kysely instance with better-sqlite3 dialect
|
|
19
|
+
* Create a Kysely instance with better-sqlite3 dialect.
|
|
22
20
|
*
|
|
23
21
|
* @example
|
|
24
22
|
* const db = createBetterSqlite3Db<MyDb>({ path: './data.db' });
|
|
@@ -30,8 +28,7 @@ export type BetterSqlite3Options = BetterSqlite3PathOptions | BetterSqlite3Insta
|
|
|
30
28
|
*/
|
|
31
29
|
export declare function createBetterSqlite3Db<T>(options: BetterSqlite3Options): Kysely<T>;
|
|
32
30
|
/**
|
|
33
|
-
* Create the better-sqlite3 dialect directly
|
|
31
|
+
* Create the better-sqlite3 dialect directly.
|
|
34
32
|
*/
|
|
35
33
|
export declare function createBetterSqlite3Dialect(options: BetterSqlite3Options): SqliteDialect;
|
|
36
|
-
export declare function createSerializePlugin(): SerializePlugin;
|
|
37
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE/C,MAAM,WAAW,wBAAwB;IACvC,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,4BAA4B;IAC3C,mDAAmD;IACnD,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED,MAAM,MAAM,oBAAoB,GAC5B,wBAAwB,GACxB,4BAA4B,CAAC;AAEjC;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,OAAO,EAAE,oBAAoB,GAC5B,MAAM,CAAC,CAAC,CAAC,CAIX;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,oBAAoB,GAC5B,aAAa,CAIf"}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @syncular/dialect-better-sqlite3 - better-sqlite3 dialect for sync
|
|
3
3
|
*
|
|
4
|
-
* Provides a Kysely dialect for better-sqlite3 (Node.js)
|
|
5
|
-
* for automatic JSON serialization/deserialization.
|
|
4
|
+
* Provides a Kysely dialect for better-sqlite3 (Node.js).
|
|
6
5
|
* SQLite-compatible — use with @syncular/server-dialect-sqlite.
|
|
7
6
|
*/
|
|
8
|
-
import { SerializePlugin } from '@syncular/core';
|
|
9
7
|
import Database from 'better-sqlite3';
|
|
10
8
|
import { Kysely, SqliteDialect } from 'kysely';
|
|
11
9
|
/**
|
|
12
|
-
* Create a Kysely instance with better-sqlite3 dialect
|
|
10
|
+
* Create a Kysely instance with better-sqlite3 dialect.
|
|
13
11
|
*
|
|
14
12
|
* @example
|
|
15
13
|
* const db = createBetterSqlite3Db<MyDb>({ path: './data.db' });
|
|
@@ -22,17 +20,13 @@ import { Kysely, SqliteDialect } from 'kysely';
|
|
|
22
20
|
export function createBetterSqlite3Db(options) {
|
|
23
21
|
return new Kysely({
|
|
24
22
|
dialect: createBetterSqlite3Dialect(options),
|
|
25
|
-
plugins: [new SerializePlugin()],
|
|
26
23
|
});
|
|
27
24
|
}
|
|
28
25
|
/**
|
|
29
|
-
* Create the better-sqlite3 dialect directly
|
|
26
|
+
* Create the better-sqlite3 dialect directly.
|
|
30
27
|
*/
|
|
31
28
|
export function createBetterSqlite3Dialect(options) {
|
|
32
29
|
const database = 'database' in options ? options.database : new Database(options.path);
|
|
33
30
|
return new SqliteDialect({ database });
|
|
34
31
|
}
|
|
35
|
-
export function createSerializePlugin() {
|
|
36
|
-
return new SerializePlugin();
|
|
37
|
-
}
|
|
38
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAgB/C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAA6B,EAClB;IACX,OAAO,IAAI,MAAM,CAAI;QACnB,OAAO,EAAE,0BAA0B,CAAC,OAAO,CAAC;KAC7C,CAAC,CAAC;AAAA,CACJ;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAA6B,EACd;IACf,MAAM,QAAQ,GACZ,UAAU,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,OAAO,IAAI,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CACxC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncular/dialect-better-sqlite3",
|
|
3
|
-
"version": "0.0.2-
|
|
3
|
+
"version": "0.0.2-135",
|
|
4
4
|
"description": "better-sqlite3 dialect for the Syncular client",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"release": "bunx syncular-publish"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@syncular/core": "0.0.2-128",
|
|
46
45
|
"@types/better-sqlite3": "^7.6.13",
|
|
47
46
|
"better-sqlite3": "^12.6.2"
|
|
48
47
|
},
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @syncular/dialect-better-sqlite3 - better-sqlite3 dialect for sync
|
|
3
3
|
*
|
|
4
|
-
* Provides a Kysely dialect for better-sqlite3 (Node.js)
|
|
5
|
-
* for automatic JSON serialization/deserialization.
|
|
4
|
+
* Provides a Kysely dialect for better-sqlite3 (Node.js).
|
|
6
5
|
* SQLite-compatible — use with @syncular/server-dialect-sqlite.
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
|
-
import { SerializePlugin } from '@syncular/core';
|
|
10
8
|
import type { Database as BetterSqlite3Database } from 'better-sqlite3';
|
|
11
9
|
import Database from 'better-sqlite3';
|
|
12
10
|
import { Kysely, SqliteDialect } from 'kysely';
|
|
@@ -26,7 +24,7 @@ export type BetterSqlite3Options =
|
|
|
26
24
|
| BetterSqlite3InstanceOptions;
|
|
27
25
|
|
|
28
26
|
/**
|
|
29
|
-
* Create a Kysely instance with better-sqlite3 dialect
|
|
27
|
+
* Create a Kysely instance with better-sqlite3 dialect.
|
|
30
28
|
*
|
|
31
29
|
* @example
|
|
32
30
|
* const db = createBetterSqlite3Db<MyDb>({ path: './data.db' });
|
|
@@ -41,12 +39,11 @@ export function createBetterSqlite3Db<T>(
|
|
|
41
39
|
): Kysely<T> {
|
|
42
40
|
return new Kysely<T>({
|
|
43
41
|
dialect: createBetterSqlite3Dialect(options),
|
|
44
|
-
plugins: [new SerializePlugin()],
|
|
45
42
|
});
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
/**
|
|
49
|
-
* Create the better-sqlite3 dialect directly
|
|
46
|
+
* Create the better-sqlite3 dialect directly.
|
|
50
47
|
*/
|
|
51
48
|
export function createBetterSqlite3Dialect(
|
|
52
49
|
options: BetterSqlite3Options
|
|
@@ -55,7 +52,3 @@ export function createBetterSqlite3Dialect(
|
|
|
55
52
|
'database' in options ? options.database : new Database(options.path);
|
|
56
53
|
return new SqliteDialect({ database });
|
|
57
54
|
}
|
|
58
|
-
|
|
59
|
-
export function createSerializePlugin(): SerializePlugin {
|
|
60
|
-
return new SerializePlugin();
|
|
61
|
-
}
|