@syncular/dialect-d1 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,16 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @syncular/dialect-d1 - Cloudflare D1 dialect for sync
|
|
3
3
|
*
|
|
4
|
-
* Provides a Kysely dialect for Cloudflare D1
|
|
5
|
-
* for automatic JSON serialization/deserialization.
|
|
4
|
+
* Provides a Kysely dialect for Cloudflare D1.
|
|
6
5
|
* SQLite-compatible — use with @syncular/server-dialect-sqlite.
|
|
7
6
|
*/
|
|
8
7
|
import type { D1Database } from '@cloudflare/workers-types';
|
|
9
|
-
import { SerializePlugin } from '@syncular/core';
|
|
10
8
|
import { Kysely } from 'kysely';
|
|
11
9
|
import { D1Dialect } from 'kysely-d1';
|
|
12
10
|
/**
|
|
13
|
-
* Create a Kysely instance with Cloudflare D1 dialect
|
|
11
|
+
* Create a Kysely instance with Cloudflare D1 dialect.
|
|
14
12
|
*
|
|
15
13
|
* @example
|
|
16
14
|
* export default {
|
|
@@ -24,8 +22,7 @@ import { D1Dialect } from 'kysely-d1';
|
|
|
24
22
|
*/
|
|
25
23
|
export declare function createD1Db<T>(database: D1Database): Kysely<T>;
|
|
26
24
|
/**
|
|
27
|
-
* Create the D1 dialect directly
|
|
25
|
+
* Create the D1 dialect directly.
|
|
28
26
|
*/
|
|
29
27
|
export declare function createD1Dialect(database: D1Database): D1Dialect;
|
|
30
|
-
export declare function createSerializePlugin(): SerializePlugin;
|
|
31
28
|
//# 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,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAI7D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,UAAU,GAAG,SAAS,CAE/D"}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @syncular/dialect-d1 - Cloudflare D1 dialect for sync
|
|
3
3
|
*
|
|
4
|
-
* Provides a Kysely dialect for Cloudflare D1
|
|
5
|
-
* for automatic JSON serialization/deserialization.
|
|
4
|
+
* Provides a Kysely dialect for Cloudflare D1.
|
|
6
5
|
* SQLite-compatible — use with @syncular/server-dialect-sqlite.
|
|
7
6
|
*/
|
|
8
|
-
import { SerializePlugin } from '@syncular/core';
|
|
9
7
|
import { Kysely } from 'kysely';
|
|
10
8
|
import { D1Dialect } from 'kysely-d1';
|
|
11
9
|
/**
|
|
12
|
-
* Create a Kysely instance with Cloudflare D1 dialect
|
|
10
|
+
* Create a Kysely instance with Cloudflare D1 dialect.
|
|
13
11
|
*
|
|
14
12
|
* @example
|
|
15
13
|
* export default {
|
|
@@ -24,16 +22,12 @@ import { D1Dialect } from 'kysely-d1';
|
|
|
24
22
|
export function createD1Db(database) {
|
|
25
23
|
return new Kysely({
|
|
26
24
|
dialect: createD1Dialect(database),
|
|
27
|
-
plugins: [new SerializePlugin()],
|
|
28
25
|
});
|
|
29
26
|
}
|
|
30
27
|
/**
|
|
31
|
-
* Create the D1 dialect directly
|
|
28
|
+
* Create the D1 dialect directly.
|
|
32
29
|
*/
|
|
33
30
|
export function createD1Dialect(database) {
|
|
34
31
|
return new D1Dialect({ database });
|
|
35
32
|
}
|
|
36
|
-
export function createSerializePlugin() {
|
|
37
|
-
return new SerializePlugin();
|
|
38
|
-
}
|
|
39
33
|
//# 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,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,UAAU,CAAI,QAAoB,EAAa;IAC7D,OAAO,IAAI,MAAM,CAAI;QACnB,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC;KACnC,CAAC,CAAC;AAAA,CACJ;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAoB,EAAa;IAC/D,OAAO,IAAI,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CACpC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncular/dialect-d1",
|
|
3
|
-
"version": "0.0.2-
|
|
3
|
+
"version": "0.0.2-135",
|
|
4
4
|
"description": "Cloudflare D1 dialect for the Syncular client",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@cloudflare/workers-types": "*",
|
|
47
|
-
"@syncular/core": "0.0.2-128",
|
|
48
47
|
"kysely-d1": "^0.4.0"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @syncular/dialect-d1 - Cloudflare D1 dialect for sync
|
|
3
3
|
*
|
|
4
|
-
* Provides a Kysely dialect for Cloudflare D1
|
|
5
|
-
* for automatic JSON serialization/deserialization.
|
|
4
|
+
* Provides a Kysely dialect for Cloudflare D1.
|
|
6
5
|
* SQLite-compatible — use with @syncular/server-dialect-sqlite.
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
8
|
import type { D1Database } from '@cloudflare/workers-types';
|
|
10
|
-
import { SerializePlugin } from '@syncular/core';
|
|
11
9
|
import { Kysely } from 'kysely';
|
|
12
10
|
import { D1Dialect } from 'kysely-d1';
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
|
-
* Create a Kysely instance with Cloudflare D1 dialect
|
|
13
|
+
* Create a Kysely instance with Cloudflare D1 dialect.
|
|
16
14
|
*
|
|
17
15
|
* @example
|
|
18
16
|
* export default {
|
|
@@ -27,17 +25,12 @@ import { D1Dialect } from 'kysely-d1';
|
|
|
27
25
|
export function createD1Db<T>(database: D1Database): Kysely<T> {
|
|
28
26
|
return new Kysely<T>({
|
|
29
27
|
dialect: createD1Dialect(database),
|
|
30
|
-
plugins: [new SerializePlugin()],
|
|
31
28
|
});
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
/**
|
|
35
|
-
* Create the D1 dialect directly
|
|
32
|
+
* Create the D1 dialect directly.
|
|
36
33
|
*/
|
|
37
34
|
export function createD1Dialect(database: D1Database): D1Dialect {
|
|
38
35
|
return new D1Dialect({ database });
|
|
39
36
|
}
|
|
40
|
-
|
|
41
|
-
export function createSerializePlugin(): SerializePlugin {
|
|
42
|
-
return new SerializePlugin();
|
|
43
|
-
}
|