@syncular/dialect-d1 0.0.1 → 0.0.2-127

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 ADDED
@@ -0,0 +1,31 @@
1
+ # @syncular/dialect-d1
2
+
3
+ Cloudflare D1 Kysely dialect with JSON serialization support via `SerializePlugin`.
4
+
5
+ Pair with `@syncular/server-dialect-sqlite` when running a Syncular server on a SQLite-compatible backend.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @syncular/dialect-d1
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { createD1Db } from '@syncular/dialect-d1';
17
+
18
+ const db = createD1Db<MyDb>(env.DB);
19
+ ```
20
+
21
+ ## Documentation
22
+
23
+ - Dialect selection: https://syncular.dev/docs/introduction/installation#client-database-dialects
24
+ - Cloudflare adapter: https://syncular.dev/docs/server/cloudflare-adapter
25
+
26
+ ## Links
27
+
28
+ - GitHub: https://github.com/syncular/syncular
29
+ - Issues: https://github.com/syncular/syncular/issues
30
+
31
+ > Status: Alpha. APIs may change between releases.
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@
8
8
  import type { D1Database } from '@cloudflare/workers-types';
9
9
  import { SerializePlugin } from '@syncular/core';
10
10
  import { Kysely } from 'kysely';
11
+ import { D1Dialect } from 'kysely-d1';
11
12
  /**
12
13
  * Create a Kysely instance with Cloudflare D1 dialect and SerializePlugin.
13
14
  *
@@ -22,5 +23,9 @@ import { Kysely } from 'kysely';
22
23
  * };
23
24
  */
24
25
  export declare function createD1Db<T>(database: D1Database): Kysely<T>;
26
+ /**
27
+ * Create the D1 dialect directly (without SerializePlugin).
28
+ */
29
+ export declare function createD1Dialect(database: D1Database): D1Dialect;
25
30
  export declare function createSerializePlugin(): SerializePlugin;
26
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAK7D;AASD,wBAAgB,qBAAqB,IAAI,eAAe,CAEvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,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,CAK7D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,UAAU,GAAG,SAAS,CAE/D;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CAEvD"}
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ export function createD1Db(database) {
30
30
  /**
31
31
  * Create the D1 dialect directly (without SerializePlugin).
32
32
  */
33
- function createD1Dialect(database) {
33
+ export function createD1Dialect(database) {
34
34
  return new D1Dialect({ database });
35
35
  }
36
36
  export function createSerializePlugin() {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,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dialect-d1",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-127",
4
+ "description": "Cloudflare D1 dialect for the Syncular client",
5
+ "license": "MIT",
6
+ "author": "Benjamin Kniffler",
7
+ "homepage": "https://syncular.dev",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/syncular/syncular.git",
11
+ "directory": "packages/dialect-d1"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/syncular/syncular/issues"
15
+ },
16
+ "keywords": [
17
+ "sync",
18
+ "offline-first",
19
+ "realtime",
20
+ "database",
21
+ "typescript",
22
+ "cloudflare",
23
+ "d1",
24
+ "sqlite"
25
+ ],
4
26
  "private": false,
5
27
  "publishConfig": {
6
28
  "access": "public"
@@ -17,18 +39,19 @@
17
39
  },
18
40
  "scripts": {
19
41
  "tsgo": "tsgo --noEmit",
20
- "build": "rm -rf dist && tsgo"
42
+ "build": "tsgo",
43
+ "release": "bunx syncular-publish"
21
44
  },
22
45
  "dependencies": {
23
- "@cloudflare/workers-types": "^4.20260207.0",
24
- "@syncular/core": "workspace:*",
46
+ "@cloudflare/workers-types": "*",
47
+ "@syncular/core": "0.0.2-127",
25
48
  "kysely-d1": "^0.4.0"
26
49
  },
27
50
  "peerDependencies": {
28
51
  "kysely": "^0.28.0"
29
52
  },
30
53
  "devDependencies": {
31
- "@syncular/config": "workspace:*",
54
+ "@syncular/config": "0.0.0",
32
55
  "kysely": "*"
33
56
  },
34
57
  "files": [
package/src/index.ts CHANGED
@@ -34,7 +34,7 @@ export function createD1Db<T>(database: D1Database): Kysely<T> {
34
34
  /**
35
35
  * Create the D1 dialect directly (without SerializePlugin).
36
36
  */
37
- function createD1Dialect(database: D1Database): D1Dialect {
37
+ export function createD1Dialect(database: D1Database): D1Dialect {
38
38
  return new D1Dialect({ database });
39
39
  }
40
40