@dxos/sql-sqlite 0.0.0 → 0.8.4-main.59c2e9b

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.
Files changed (92) hide show
  1. package/dist/lib/browser/OpfsWorker.mjs +8 -0
  2. package/dist/lib/browser/OpfsWorker.mjs.map +7 -0
  3. package/dist/lib/browser/SqlExport.mjs +8 -0
  4. package/dist/lib/browser/SqlExport.mjs.map +7 -0
  5. package/dist/lib/browser/SqlTransaction.mjs +17 -0
  6. package/dist/lib/browser/SqlTransaction.mjs.map +7 -0
  7. package/dist/lib/browser/SqliteClient.mjs +26 -0
  8. package/dist/lib/browser/SqliteClient.mjs.map +7 -0
  9. package/dist/lib/browser/SqliteMigrator.mjs +22 -0
  10. package/dist/lib/browser/SqliteMigrator.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-FIQQSOZM.mjs +9 -0
  12. package/dist/lib/browser/chunk-FIQQSOZM.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-IEP6GGEX.mjs +23 -0
  14. package/dist/lib/browser/chunk-IEP6GGEX.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-QH6DIOHW.mjs +310 -0
  16. package/dist/lib/browser/chunk-QH6DIOHW.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-S6DY53DJ.mjs +24 -0
  18. package/dist/lib/browser/chunk-S6DY53DJ.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-YGAFWXGL.mjs +93 -0
  20. package/dist/lib/browser/chunk-YGAFWXGL.mjs.map +7 -0
  21. package/dist/lib/browser/index.mjs +16 -0
  22. package/dist/lib/browser/index.mjs.map +7 -0
  23. package/dist/lib/browser/meta.json +1 -0
  24. package/dist/lib/browser/platform/browser.mjs +24 -0
  25. package/dist/lib/browser/platform/browser.mjs.map +7 -0
  26. package/dist/lib/browser/platform/bun.mjs +23 -0
  27. package/dist/lib/browser/platform/bun.mjs.map +7 -0
  28. package/dist/lib/browser/platform/node.mjs +23 -0
  29. package/dist/lib/browser/platform/node.mjs.map +7 -0
  30. package/dist/lib/node-esm/OpfsWorker.mjs +9 -0
  31. package/dist/lib/node-esm/OpfsWorker.mjs.map +7 -0
  32. package/dist/lib/node-esm/SqlExport.mjs +9 -0
  33. package/dist/lib/node-esm/SqlExport.mjs.map +7 -0
  34. package/dist/lib/node-esm/SqlTransaction.mjs +18 -0
  35. package/dist/lib/node-esm/SqlTransaction.mjs.map +7 -0
  36. package/dist/lib/node-esm/SqliteClient.mjs +27 -0
  37. package/dist/lib/node-esm/SqliteClient.mjs.map +7 -0
  38. package/dist/lib/node-esm/SqliteMigrator.mjs +23 -0
  39. package/dist/lib/node-esm/SqliteMigrator.mjs.map +7 -0
  40. package/dist/lib/node-esm/chunk-2SZHAWBN.mjs +24 -0
  41. package/dist/lib/node-esm/chunk-2SZHAWBN.mjs.map +7 -0
  42. package/dist/lib/node-esm/chunk-B2CW3GJX.mjs +11 -0
  43. package/dist/lib/node-esm/chunk-B2CW3GJX.mjs.map +7 -0
  44. package/dist/lib/node-esm/chunk-JHEN2PHZ.mjs +25 -0
  45. package/dist/lib/node-esm/chunk-JHEN2PHZ.mjs.map +7 -0
  46. package/dist/lib/node-esm/chunk-JOE7MZKS.mjs +94 -0
  47. package/dist/lib/node-esm/chunk-JOE7MZKS.mjs.map +7 -0
  48. package/dist/lib/node-esm/chunk-L52WOGD2.mjs +311 -0
  49. package/dist/lib/node-esm/chunk-L52WOGD2.mjs.map +7 -0
  50. package/dist/lib/node-esm/index.mjs +17 -0
  51. package/dist/lib/node-esm/index.mjs.map +7 -0
  52. package/dist/lib/node-esm/meta.json +1 -0
  53. package/dist/lib/node-esm/platform/browser.mjs +25 -0
  54. package/dist/lib/node-esm/platform/browser.mjs.map +7 -0
  55. package/dist/lib/node-esm/platform/bun.mjs +24 -0
  56. package/dist/lib/node-esm/platform/bun.mjs.map +7 -0
  57. package/dist/lib/node-esm/platform/node.mjs +24 -0
  58. package/dist/lib/node-esm/platform/node.mjs.map +7 -0
  59. package/dist/types/src/OpfsWorker.d.ts +2 -0
  60. package/dist/types/src/OpfsWorker.d.ts.map +1 -0
  61. package/dist/types/src/SqlExport.d.ts +11 -0
  62. package/dist/types/src/SqlExport.d.ts.map +1 -0
  63. package/dist/types/src/SqlTransaction.d.ts +33 -0
  64. package/dist/types/src/SqlTransaction.d.ts.map +1 -0
  65. package/dist/types/src/SqliteClient.d.ts +2 -0
  66. package/dist/types/src/SqliteClient.d.ts.map +1 -0
  67. package/dist/types/src/SqliteMigrator.d.ts +2 -0
  68. package/dist/types/src/SqliteMigrator.d.ts.map +1 -0
  69. package/dist/types/src/index.d.ts +5 -0
  70. package/dist/types/src/index.d.ts.map +1 -0
  71. package/dist/types/src/platform/browser.d.ts +9 -0
  72. package/dist/types/src/platform/browser.d.ts.map +1 -0
  73. package/dist/types/src/platform/bun.d.ts +9 -0
  74. package/dist/types/src/platform/bun.d.ts.map +1 -0
  75. package/dist/types/src/platform/node.d.ts +9 -0
  76. package/dist/types/src/platform/node.d.ts.map +1 -0
  77. package/dist/types/src/testing/opfs-worker.browser.test.d.ts +2 -0
  78. package/dist/types/src/testing/opfs-worker.browser.test.d.ts.map +1 -0
  79. package/dist/types/src/testing/opfs-worker.d.ts +2 -0
  80. package/dist/types/src/testing/opfs-worker.d.ts.map +1 -0
  81. package/dist/types/src/testing/sqlite-effect-idb.browser.test.d.ts +28 -0
  82. package/dist/types/src/testing/sqlite-effect-idb.browser.test.d.ts.map +1 -0
  83. package/dist/types/src/testing/sqlite-idb.browser.test.d.ts +2 -0
  84. package/dist/types/src/testing/sqlite-idb.browser.test.d.ts.map +1 -0
  85. package/dist/types/src/testing/sqlite-memory.browser.test.d.ts +2 -0
  86. package/dist/types/src/testing/sqlite-memory.browser.test.d.ts.map +1 -0
  87. package/dist/types/tsconfig.tsbuildinfo +1 -0
  88. package/package.json +10 -1
  89. package/src/SqlTransaction.ts +44 -0
  90. package/src/platform/browser.ts +11 -10
  91. package/src/platform/bun.ts +11 -10
  92. package/src/platform/node.ts +11 -10
@@ -0,0 +1,94 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ __export
4
+ } from "./chunk-2SZHAWBN.mjs";
5
+
6
+ // ../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/OpfsWorker.js
7
+ var OpfsWorker_exports = {};
8
+ __export(OpfsWorker_exports, {
9
+ run: () => run
10
+ });
11
+ import { SqlError } from "@effect/sql/SqlError";
12
+ import * as WaSqlite from "@dxos/wa-sqlite";
13
+ import SQLiteESMFactory from "@dxos/wa-sqlite/dist/wa-sqlite.mjs";
14
+ import { AccessHandlePoolVFS } from "@dxos/wa-sqlite/src/examples/AccessHandlePoolVFS.js";
15
+ import * as Effect from "effect/Effect";
16
+ var run = (options) => Effect.gen(function* () {
17
+ const factory = yield* Effect.promise(() => SQLiteESMFactory());
18
+ const sqlite3 = WaSqlite.Factory(factory);
19
+ const vfs = yield* Effect.promise(() => AccessHandlePoolVFS.create("opfs", factory));
20
+ sqlite3.vfs_register(vfs, false);
21
+ const db = yield* Effect.acquireRelease(Effect.try({
22
+ try: () => sqlite3.open_v2(options.dbName, void 0, "opfs"),
23
+ catch: (cause) => new SqlError({
24
+ cause,
25
+ message: "Failed to open database"
26
+ })
27
+ }), (db2) => Effect.sync(() => sqlite3.close(db2)));
28
+ return yield* Effect.async((resume) => {
29
+ const onMessage = (event) => {
30
+ let messageId;
31
+ const message = event.data;
32
+ try {
33
+ switch (message[0]) {
34
+ case "close": {
35
+ options.port.close();
36
+ return resume(Effect.void);
37
+ }
38
+ case "import": {
39
+ const [, id, data] = message;
40
+ messageId = id;
41
+ sqlite3.deserialize(db, "main", data, data.length, data.length, 1 | 2);
42
+ options.port.postMessage([id, void 0, void 0]);
43
+ return;
44
+ }
45
+ case "export": {
46
+ const [, id] = message;
47
+ messageId = id;
48
+ const data = sqlite3.serialize(db, "main");
49
+ options.port.postMessage([id, void 0, data], [data.buffer]);
50
+ return;
51
+ }
52
+ case "update_hook": {
53
+ messageId = -1;
54
+ sqlite3.update_hook(db, (_op, _db, table, rowid) => {
55
+ if (!table) return;
56
+ options.port.postMessage(["update_hook", table, Number(rowid)]);
57
+ });
58
+ return;
59
+ }
60
+ default: {
61
+ const [id, sql, params] = message;
62
+ messageId = id;
63
+ const results = [];
64
+ let columns;
65
+ for (const stmt of sqlite3.statements(db, sql)) {
66
+ sqlite3.bind_collection(stmt, params);
67
+ while (sqlite3.step(stmt) === WaSqlite.SQLITE_ROW) {
68
+ columns = columns ?? sqlite3.column_names(stmt);
69
+ const row = sqlite3.row(stmt);
70
+ results.push(row);
71
+ }
72
+ }
73
+ options.port.postMessage([id, void 0, [columns, results]]);
74
+ return;
75
+ }
76
+ }
77
+ } catch (e) {
78
+ const message2 = "message" in e ? e.message : String(e);
79
+ options.port.postMessage([messageId, message2, void 0]);
80
+ }
81
+ };
82
+ options.port.addEventListener("message", onMessage);
83
+ options.port.postMessage(["ready", void 0, void 0]);
84
+ return Effect.sync(() => {
85
+ options.port.removeEventListener("message", onMessage);
86
+ });
87
+ });
88
+ }).pipe(Effect.scoped);
89
+
90
+ export {
91
+ run,
92
+ OpfsWorker_exports
93
+ };
94
+ //# sourceMappingURL=chunk-JOE7MZKS.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/src/OpfsWorker.ts"],
4
+ "sourcesContent": ["/**\n * @since 1.0.0\n */\n/// <reference lib=\"webworker\" />\nimport { SqlError } from \"@effect/sql/SqlError\"\nimport * as WaSqlite from \"@effect/wa-sqlite\"\nimport SQLiteESMFactory from \"@effect/wa-sqlite/dist/wa-sqlite.mjs\"\nimport { AccessHandlePoolVFS } from \"@effect/wa-sqlite/src/examples/AccessHandlePoolVFS.js\"\nimport * as Effect from \"effect/Effect\"\nimport type { OpfsWorkerMessage } from \"./internal/opfsWorker.js\"\n\n/**\n * @category models\n * @since 1.0.0\n */\nexport interface OpfsWorkerConfig {\n readonly port: EventTarget & Pick<MessagePort, \"postMessage\" | \"close\">\n readonly dbName: string\n}\n\n/**\n * @category constructor\n * @since 1.0.0\n */\nexport const run = (\n options: OpfsWorkerConfig\n): Effect.Effect<void, SqlError> =>\n Effect.gen(function*() {\n const factory = yield* Effect.promise(() => SQLiteESMFactory())\n const sqlite3 = WaSqlite.Factory(factory)\n const vfs = yield* Effect.promise(() => AccessHandlePoolVFS.create(\"opfs\", factory))\n sqlite3.vfs_register(vfs, false)\n const db = yield* Effect.acquireRelease(\n Effect.try({\n try: () => sqlite3.open_v2(options.dbName, undefined, \"opfs\"),\n catch: (cause) => new SqlError({ cause, message: \"Failed to open database\" })\n }),\n (db) => Effect.sync(() => sqlite3.close(db))\n )\n\n return yield* Effect.async<void>((resume) => {\n const onMessage = (event: any) => {\n let messageId: number\n const message = event.data as OpfsWorkerMessage\n try {\n switch (message[0]) {\n case \"close\": {\n options.port.close()\n return resume(Effect.void)\n }\n case \"import\": {\n const [, id, data] = message\n messageId = id\n sqlite3.deserialize(db, \"main\", data, data.length, data.length, 1 | 2)\n options.port.postMessage([id, void 0, void 0])\n return\n }\n case \"export\": {\n const [, id] = message\n messageId = id\n const data = sqlite3.serialize(db, \"main\")\n options.port.postMessage([id, undefined, data], [data.buffer])\n return\n }\n case \"update_hook\": {\n messageId = -1\n sqlite3.update_hook(db, (_op, _db, table, rowid) => {\n if (!table) return\n options.port.postMessage([\"update_hook\", table, Number(rowid)])\n })\n return\n }\n default: {\n const [id, sql, params] = message\n messageId = id\n const results: Array<any> = []\n let columns: Array<string> | undefined\n for (const stmt of sqlite3.statements(db, sql)) {\n sqlite3.bind_collection(stmt, params as any)\n while (sqlite3.step(stmt) === WaSqlite.SQLITE_ROW) {\n columns = columns ?? sqlite3.column_names(stmt)\n const row = sqlite3.row(stmt)\n results.push(row)\n }\n }\n options.port.postMessage([id, undefined, [columns, results]])\n return\n }\n }\n } catch (e: any) {\n const message = \"message\" in e ? e.message : String(e)\n options.port.postMessage([messageId!, message, undefined])\n }\n }\n options.port.addEventListener(\"message\", onMessage)\n options.port.postMessage([\"ready\", undefined, undefined])\n return Effect.sync(() => {\n options.port.removeEventListener(\"message\", onMessage)\n })\n })\n }).pipe(Effect.scoped)\n"],
5
+ "mappings": ";;;;;;AAAA;;;;AAIA,SAASA,gBAAgB;AACzB,YAAYC,cAAc;AAC1B,OAAOC,sBAAsB;AAC7B,SAASC,2BAA2B;AACpC,YAAYC,YAAY;AAgBjB,IAAMC,MACXC,aAEOC,WAAI,aAAS;AAClB,QAAMC,UAAU,OAAcC,eAAQ,MAAMP,iBAAgB,CAAE;AAC9D,QAAMQ,UAAmBC,iBAAQH,OAAO;AACxC,QAAMI,MAAM,OAAcH,eAAQ,MAAMN,oBAAoBU,OAAO,QAAQL,OAAO,CAAC;AACnFE,UAAQI,aAAaF,KAAK,KAAK;AAC/B,QAAMG,KAAK,OAAcC,sBAChBC,WAAI;IACTA,KAAKA,MAAMP,QAAQQ,QAAQZ,QAAQa,QAAQC,QAAW,MAAM;IAC5DC,OAAQC,WAAU,IAAItB,SAAS;MAAEsB;MAAOC,SAAS;IAAyB,CAAE;GAC7E,GACAR,CAAAA,QAAcS,YAAK,MAAMd,QAAQe,MAAMV,GAAE,CAAC,CAAC;AAG9C,SAAO,OAAcW,aAAaC,YAAU;AAC1C,UAAMC,YAAaC,WAAc;AAC/B,UAAIC;AACJ,YAAMP,UAAUM,MAAME;AACtB,UAAI;AACF,gBAAQR,QAAQ,CAAC,GAAC;UAChB,KAAK,SAAS;AACZjB,oBAAQ0B,KAAKP,MAAK;AAClB,mBAAOE,OAAcM,WAAI;UAC3B;UACA,KAAK,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IAAIA,EAAEnC,UAAUoC,OAAOD,CAAC;AACrDpD,gBAAQ0B,KAAKK,YAAY,CAACP,WAAYP,UAASH,MAAS,CAAC;MAC3D;IACF;AACAd,YAAQ0B,KAAK4B,iBAAiB,WAAWhC,SAAS;AAClDtB,YAAQ0B,KAAKK,YAAY,CAAC,SAASjB,QAAWA,MAAS,CAAC;AACxD,WAAcI,YAAK,MAAK;AACtBlB,cAAQ0B,KAAK6B,oBAAoB,WAAWjC,SAAS;IACvD,CAAC;EACH,CAAC;AACH,CAAC,EAAEkC,KAAYC,aAAM;",
6
+ "names": ["SqlError", "WaSqlite", "SQLiteESMFactory", "AccessHandlePoolVFS", "Effect", "run", "options", "gen", "factory", "promise", "sqlite3", "Factory", "vfs", "create", "vfs_register", "db", "acquireRelease", "try", "open_v2", "dbName", "undefined", "catch", "cause", "message", "sync", "close", "async", "resume", "onMessage", "event", "messageId", "data", "port", "void", "id", "deserialize", "length", "postMessage", "serialize", "buffer", "update_hook", "_op", "_db", "table", "rowid", "Number", "sql", "params", "results", "columns", "stmt", "statements", "bind_collection", "step", "SQLITE_ROW", "column_names", "row", "push", "e", "String", "addEventListener", "removeEventListener", "pipe", "scoped"]
7
+ }
@@ -0,0 +1,311 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ __export
4
+ } from "./chunk-2SZHAWBN.mjs";
5
+
6
+ // ../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteClient.js
7
+ var SqliteClient_exports = {};
8
+ __export(SqliteClient_exports, {
9
+ SqliteClient: () => SqliteClient,
10
+ TypeId: () => TypeId,
11
+ currentTransferables: () => currentTransferables,
12
+ layer: () => layer2,
13
+ layerConfig: () => layerConfig,
14
+ layerMemory: () => layerMemory,
15
+ layerMemoryConfig: () => layerMemoryConfig,
16
+ make: () => make4,
17
+ makeMemory: () => makeMemory,
18
+ withTransferables: () => withTransferables
19
+ });
20
+ import * as Reactivity from "@effect/experimental/Reactivity";
21
+ import * as Client from "@effect/sql/SqlClient";
22
+ import { SqlError } from "@effect/sql/SqlError";
23
+ import * as Statement from "@effect/sql/Statement";
24
+ import * as WaSqlite from "@dxos/wa-sqlite";
25
+ import SQLiteESMFactory from "@dxos/wa-sqlite/dist/wa-sqlite.mjs";
26
+ import { MemoryVFS } from "@dxos/wa-sqlite/src/examples/MemoryVFS.js";
27
+ import * as Chunk from "effect/Chunk";
28
+ import * as Config from "effect/Config";
29
+ import * as Context from "effect/Context";
30
+ import * as Deferred from "effect/Deferred";
31
+ import * as Effect from "effect/Effect";
32
+ import * as Exit from "effect/Exit";
33
+ import * as FiberRef from "effect/FiberRef";
34
+ import { identity } from "effect/Function";
35
+ import { globalValue } from "effect/GlobalValue";
36
+ import * as Layer from "effect/Layer";
37
+ import * as Scope from "effect/Scope";
38
+ import * as ScopedRef from "effect/ScopedRef";
39
+ import * as Stream from "effect/Stream";
40
+ var ATTR_DB_SYSTEM_NAME = "db.system.name";
41
+ var TypeId = /* @__PURE__ */ Symbol.for("@effect/sql-sqlite-wasm/SqliteClient");
42
+ var SqliteClient = /* @__PURE__ */ Context.GenericTag("@effect/sql-sqlite-wasm/SqliteClient");
43
+ var initModule = /* @__PURE__ */ Effect.runSync(/* @__PURE__ */ Effect.cached(/* @__PURE__ */ Effect.promise(() => SQLiteESMFactory())));
44
+ var initEffect = /* @__PURE__ */ Effect.runSync(/* @__PURE__ */ Effect.cached(/* @__PURE__ */ initModule.pipe(/* @__PURE__ */ Effect.map((module) => WaSqlite.Factory(module)))));
45
+ var registered = /* @__PURE__ */ globalValue("@effect/sql-sqlite-wasm/registered", () => /* @__PURE__ */ new Set());
46
+ var makeMemory = (options) => Effect.gen(function* () {
47
+ const reactivity = yield* Reactivity.Reactivity;
48
+ const compiler = Statement.makeCompilerSqlite(options.transformQueryNames);
49
+ const transformRows = options.transformResultNames ? Statement.defaultTransforms(options.transformResultNames).array : void 0;
50
+ const makeConnection = Effect.gen(function* () {
51
+ const sqlite3 = yield* initEffect;
52
+ if (registered.has("memory-vfs") === false) {
53
+ registered.add("memory-vfs");
54
+ const module = yield* initModule;
55
+ const vfs = new MemoryVFS("memory-vfs", module);
56
+ sqlite3.vfs_register(vfs, false);
57
+ }
58
+ const db = yield* Effect.acquireRelease(Effect.try({
59
+ try: () => sqlite3.open_v2(":memory:", void 0, "memory-vfs"),
60
+ catch: (cause) => new SqlError({
61
+ cause,
62
+ message: "Failed to open database"
63
+ })
64
+ }), (db2) => Effect.sync(() => sqlite3.close(db2)));
65
+ if (options.installReactivityHooks) {
66
+ sqlite3.update_hook(db, (_op, _db, table, rowid) => {
67
+ if (!table) return;
68
+ const id = String(Number(rowid));
69
+ reactivity.unsafeInvalidate({
70
+ [table]: [id]
71
+ });
72
+ });
73
+ }
74
+ const run = (sql, params = [], rowMode = "object") => Effect.try({
75
+ try: () => {
76
+ const results = [];
77
+ for (const stmt of sqlite3.statements(db, sql)) {
78
+ let columns;
79
+ sqlite3.bind_collection(stmt, params);
80
+ while (sqlite3.step(stmt) === WaSqlite.SQLITE_ROW) {
81
+ columns = columns ?? sqlite3.column_names(stmt);
82
+ const row = sqlite3.row(stmt);
83
+ if (rowMode === "object") {
84
+ const obj = {};
85
+ for (let i = 0; i < columns.length; i++) {
86
+ obj[columns[i]] = row[i];
87
+ }
88
+ results.push(obj);
89
+ } else {
90
+ results.push(row);
91
+ }
92
+ }
93
+ }
94
+ return results;
95
+ },
96
+ catch: (cause) => new SqlError({
97
+ cause,
98
+ message: "Failed to execute statement"
99
+ })
100
+ });
101
+ return identity({
102
+ execute(sql, params, transformRows2) {
103
+ return transformRows2 ? Effect.map(run(sql, params), transformRows2) : run(sql, params);
104
+ },
105
+ executeRaw(sql, params) {
106
+ return run(sql, params);
107
+ },
108
+ executeValues(sql, params) {
109
+ return run(sql, params, "array");
110
+ },
111
+ executeUnprepared(sql, params, transformRows2) {
112
+ return this.execute(sql, params, transformRows2);
113
+ },
114
+ executeStream(sql, params, transformRows2) {
115
+ function* stream() {
116
+ for (const stmt of sqlite3.statements(db, sql)) {
117
+ let columns;
118
+ sqlite3.bind_collection(stmt, params);
119
+ while (sqlite3.step(stmt) === WaSqlite.SQLITE_ROW) {
120
+ columns = columns ?? sqlite3.column_names(stmt);
121
+ const row = sqlite3.row(stmt);
122
+ const obj = {};
123
+ for (let i = 0; i < columns.length; i++) {
124
+ obj[columns[i]] = row[i];
125
+ }
126
+ yield obj;
127
+ }
128
+ }
129
+ }
130
+ return Stream.suspend(() => Stream.fromIteratorSucceed(stream()[Symbol.iterator]())).pipe(transformRows2 ? Stream.mapChunks((chunk) => Chunk.unsafeFromArray(transformRows2(Chunk.toReadonlyArray(chunk)))) : identity, Stream.mapError((cause) => new SqlError({
131
+ cause,
132
+ message: "Failed to execute statement"
133
+ })));
134
+ },
135
+ export: Effect.try({
136
+ try: () => sqlite3.serialize(db, "main"),
137
+ catch: (cause) => new SqlError({
138
+ cause,
139
+ message: "Failed to export database"
140
+ })
141
+ }),
142
+ import(data) {
143
+ return Effect.try({
144
+ try: () => sqlite3.deserialize(db, "main", data, data.length, data.length, 1 | 2),
145
+ catch: (cause) => new SqlError({
146
+ cause,
147
+ message: "Failed to import database"
148
+ })
149
+ });
150
+ }
151
+ });
152
+ });
153
+ const semaphore = yield* Effect.makeSemaphore(1);
154
+ const connection = yield* makeConnection;
155
+ const acquirer = semaphore.withPermits(1)(Effect.succeed(connection));
156
+ const transactionAcquirer = Effect.uninterruptibleMask((restore) => Effect.as(Effect.zipRight(restore(semaphore.take(1)), Effect.tap(Effect.scope, (scope2) => Scope.addFinalizer(scope2, semaphore.release(1)))), connection));
157
+ return Object.assign(yield* Client.make({
158
+ acquirer,
159
+ compiler,
160
+ transactionAcquirer,
161
+ spanAttributes: [...options.spanAttributes ? Object.entries(options.spanAttributes) : [], [ATTR_DB_SYSTEM_NAME, "sqlite"]],
162
+ transformRows
163
+ }), {
164
+ [TypeId]: TypeId,
165
+ config: options,
166
+ export: semaphore.withPermits(1)(connection.export),
167
+ import(data) {
168
+ return semaphore.withPermits(1)(connection.import(data));
169
+ }
170
+ });
171
+ });
172
+ var make4 = (options) => Effect.gen(function* () {
173
+ const reactivity = yield* Reactivity.Reactivity;
174
+ const compiler = Statement.makeCompilerSqlite(options.transformQueryNames);
175
+ const transformRows = options.transformResultNames ? Statement.defaultTransforms(options.transformResultNames).array : void 0;
176
+ const pending = /* @__PURE__ */ new Map();
177
+ const makeConnection = Effect.gen(function* () {
178
+ let currentId = 0;
179
+ const scope2 = yield* Effect.scope;
180
+ const readyDeferred = yield* Deferred.make();
181
+ const worker = yield* options.worker;
182
+ const port = "port" in worker ? worker.port : worker;
183
+ const postMessage = (message, transferables) => port.postMessage(message, transferables);
184
+ yield* Scope.addFinalizer(scope2, Effect.sync(() => postMessage(["close"])));
185
+ const onMessage = (event) => {
186
+ const [id, error, results] = event.data;
187
+ if (id === "ready") {
188
+ Deferred.unsafeDone(readyDeferred, Exit.void);
189
+ return;
190
+ } else if (id === "update_hook") {
191
+ reactivity.unsafeInvalidate({
192
+ [error]: [results]
193
+ });
194
+ return;
195
+ } else {
196
+ const resume = pending.get(id);
197
+ if (!resume) return;
198
+ pending.delete(id);
199
+ if (error) {
200
+ resume(Exit.fail(new SqlError({
201
+ cause: error,
202
+ message: "Failed to execute statement"
203
+ })));
204
+ } else {
205
+ resume(Exit.succeed(results));
206
+ }
207
+ }
208
+ };
209
+ port.addEventListener("message", onMessage);
210
+ function onError() {
211
+ Effect.runFork(ScopedRef.set(connectionRef, makeConnection));
212
+ }
213
+ if ("onerror" in worker) {
214
+ worker.addEventListener("error", onError);
215
+ }
216
+ yield* Scope.addFinalizer(scope2, Effect.sync(() => {
217
+ worker.removeEventListener("message", onMessage);
218
+ worker.removeEventListener("error", onError);
219
+ }));
220
+ yield* Deferred.await(readyDeferred);
221
+ if (options.installReactivityHooks) {
222
+ postMessage(["update_hook"]);
223
+ }
224
+ const send = (id, message, transferables) => Effect.async((resume) => {
225
+ pending.set(id, resume);
226
+ postMessage(message, transferables);
227
+ });
228
+ const run = (sql, params = [], rowMode = "object") => {
229
+ const rows = Effect.withFiberRuntime((fiber) => {
230
+ const id = currentId++;
231
+ return send(id, [id, sql, params], fiber.getFiberRef(currentTransferables));
232
+ });
233
+ return rowMode === "object" ? Effect.map(rows, extractObject) : Effect.map(rows, extractRows);
234
+ };
235
+ return identity({
236
+ execute(sql, params, transformRows2) {
237
+ return transformRows2 ? Effect.map(run(sql, params), transformRows2) : run(sql, params);
238
+ },
239
+ executeRaw(sql, params) {
240
+ return run(sql, params);
241
+ },
242
+ executeValues(sql, params) {
243
+ return run(sql, params, "array");
244
+ },
245
+ executeUnprepared(sql, params, transformRows2) {
246
+ return this.execute(sql, params, transformRows2);
247
+ },
248
+ executeStream() {
249
+ return Effect.dieMessage("executeStream not implemented");
250
+ },
251
+ export: Effect.suspend(() => {
252
+ const id = currentId++;
253
+ return send(id, ["export", id]);
254
+ }),
255
+ import(data) {
256
+ return Effect.suspend(() => {
257
+ const id = currentId++;
258
+ return send(id, ["import", id, data], [data.buffer]);
259
+ });
260
+ }
261
+ });
262
+ });
263
+ const connectionRef = yield* ScopedRef.fromAcquire(makeConnection);
264
+ const semaphore = yield* Effect.makeSemaphore(1);
265
+ const acquirer = semaphore.withPermits(1)(ScopedRef.get(connectionRef));
266
+ const transactionAcquirer = Effect.uninterruptibleMask((restore) => Effect.zipRight(Effect.zipRight(restore(semaphore.take(1)), Effect.tap(Effect.scope, (scope2) => Scope.addFinalizer(scope2, semaphore.release(1)))), ScopedRef.get(connectionRef)));
267
+ return Object.assign(yield* Client.make({
268
+ acquirer,
269
+ compiler,
270
+ transactionAcquirer,
271
+ spanAttributes: [...options.spanAttributes ? Object.entries(options.spanAttributes) : [], [ATTR_DB_SYSTEM_NAME, "sqlite"]],
272
+ transformRows
273
+ }), {
274
+ [TypeId]: TypeId,
275
+ config: options,
276
+ export: Effect.flatMap(acquirer, (connection) => connection.export),
277
+ import(data) {
278
+ return Effect.flatMap(acquirer, (connection) => connection.import(data));
279
+ }
280
+ });
281
+ });
282
+ function rowToObject(columns, row) {
283
+ const obj = {};
284
+ for (let i = 0; i < columns.length; i++) {
285
+ obj[columns[i]] = row[i];
286
+ }
287
+ return obj;
288
+ }
289
+ var extractObject = (rows) => rows[1].map((row) => rowToObject(rows[0], row));
290
+ var extractRows = (rows) => rows[1];
291
+ var currentTransferables = /* @__PURE__ */ globalValue("@effect/sql-sqlite-wasm/currentTransferables", () => FiberRef.unsafeMake([]));
292
+ var withTransferables = (transferables) => (effect) => Effect.locally(effect, currentTransferables, transferables);
293
+ var layerMemoryConfig = (config) => Layer.scopedContext(Config.unwrap(config).pipe(Effect.flatMap(makeMemory), Effect.map((client) => Context.make(SqliteClient, client).pipe(Context.add(Client.SqlClient, client))))).pipe(Layer.provide(Reactivity.layer));
294
+ var layerMemory = (config) => Layer.scopedContext(Effect.map(makeMemory(config), (client) => Context.make(SqliteClient, client).pipe(Context.add(Client.SqlClient, client)))).pipe(Layer.provide(Reactivity.layer));
295
+ var layer2 = (config) => Layer.scopedContext(Effect.map(make4(config), (client) => Context.make(SqliteClient, client).pipe(Context.add(Client.SqlClient, client)))).pipe(Layer.provide(Reactivity.layer));
296
+ var layerConfig = (config) => Layer.scopedContext(Config.unwrap(config).pipe(Effect.flatMap(make4), Effect.map((client) => Context.make(SqliteClient, client).pipe(Context.add(Client.SqlClient, client))))).pipe(Layer.provide(Reactivity.layer));
297
+
298
+ export {
299
+ TypeId,
300
+ SqliteClient,
301
+ makeMemory,
302
+ make4 as make,
303
+ currentTransferables,
304
+ withTransferables,
305
+ layerMemoryConfig,
306
+ layerMemory,
307
+ layer2 as layer,
308
+ layerConfig,
309
+ SqliteClient_exports
310
+ };
311
+ //# sourceMappingURL=chunk-L52WOGD2.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/src/SqliteClient.ts"],
4
+ "sourcesContent": ["/**\n * @since 1.0.0\n */\nimport * as Reactivity from \"@effect/experimental/Reactivity\"\nimport * as Client from \"@effect/sql/SqlClient\"\nimport type { Connection } from \"@effect/sql/SqlConnection\"\nimport { SqlError } from \"@effect/sql/SqlError\"\nimport * as Statement from \"@effect/sql/Statement\"\nimport * as WaSqlite from \"@effect/wa-sqlite\"\nimport SQLiteESMFactory from \"@effect/wa-sqlite/dist/wa-sqlite.mjs\"\nimport { MemoryVFS } from \"@effect/wa-sqlite/src/examples/MemoryVFS.js\"\nimport * as Chunk from \"effect/Chunk\"\nimport * as Config from \"effect/Config\"\nimport type { ConfigError } from \"effect/ConfigError\"\nimport * as Context from \"effect/Context\"\nimport * as Deferred from \"effect/Deferred\"\nimport * as Effect from \"effect/Effect\"\nimport * as Exit from \"effect/Exit\"\nimport * as FiberRef from \"effect/FiberRef\"\nimport { identity } from \"effect/Function\"\nimport { globalValue } from \"effect/GlobalValue\"\nimport * as Layer from \"effect/Layer\"\nimport * as Scope from \"effect/Scope\"\nimport * as ScopedRef from \"effect/ScopedRef\"\nimport * as Stream from \"effect/Stream\"\nimport type { OpfsWorkerMessage } from \"./internal/opfsWorker.js\"\n\nconst ATTR_DB_SYSTEM_NAME = \"db.system.name\"\n\n/**\n * @category type ids\n * @since 1.0.0\n */\nexport const TypeId: unique symbol = Symbol.for(\"@effect/sql-sqlite-wasm/SqliteClient\")\n\n/**\n * @category type ids\n * @since 1.0.0\n */\nexport type TypeId = typeof TypeId\n\n/**\n * @category models\n * @since 1.0.0\n */\nexport interface SqliteClient extends Client.SqlClient {\n readonly [TypeId]: TypeId\n readonly config: SqliteClientMemoryConfig\n readonly export: Effect.Effect<Uint8Array, SqlError>\n readonly import: (data: Uint8Array) => Effect.Effect<void, SqlError>\n\n /** Not supported in sqlite */\n readonly updateValues: never\n}\n\n/**\n * @category tags\n * @since 1.0.0\n */\nexport const SqliteClient = Context.GenericTag<SqliteClient>(\"@effect/sql-sqlite-wasm/SqliteClient\")\n\n/**\n * @category models\n * @since 1.0.0\n */\nexport interface SqliteClientMemoryConfig {\n readonly installReactivityHooks?: boolean\n readonly spanAttributes?: Record<string, unknown>\n readonly transformResultNames?: (str: string) => string\n readonly transformQueryNames?: (str: string) => string\n}\n\n/**\n * @category models\n * @since 1.0.0\n */\nexport interface SqliteClientConfig {\n readonly worker: Effect.Effect<Worker | SharedWorker | MessagePort, never, Scope.Scope>\n readonly installReactivityHooks?: boolean\n readonly spanAttributes?: Record<string, unknown>\n readonly transformResultNames?: (str: string) => string\n readonly transformQueryNames?: (str: string) => string\n}\n\ninterface SqliteConnection extends Connection {\n readonly export: Effect.Effect<Uint8Array, SqlError>\n readonly import: (data: Uint8Array) => Effect.Effect<void, SqlError>\n}\n\nconst initModule = Effect.runSync(\n Effect.cached(Effect.promise(() => SQLiteESMFactory()))\n)\n\nconst initEffect = Effect.runSync(\n Effect.cached(initModule.pipe(Effect.map((module) => WaSqlite.Factory(module))))\n)\n\nconst registered = globalValue(\"@effect/sql-sqlite-wasm/registered\", () => new Set<string>())\n\n/**\n * @category constructor\n * @since 1.0.0\n */\nexport const makeMemory = (\n options: SqliteClientMemoryConfig\n): Effect.Effect<SqliteClient, SqlError, Scope.Scope | Reactivity.Reactivity> =>\n Effect.gen(function*() {\n const reactivity = yield* Reactivity.Reactivity\n const compiler = Statement.makeCompilerSqlite(options.transformQueryNames)\n const transformRows = options.transformResultNames ?\n Statement.defaultTransforms(\n options.transformResultNames\n ).array :\n undefined\n\n const makeConnection = Effect.gen(function*() {\n const sqlite3 = yield* initEffect\n\n if (registered.has(\"memory-vfs\") === false) {\n registered.add(\"memory-vfs\")\n const module = yield* initModule\n // @ts-expect-error\n const vfs = new MemoryVFS(\"memory-vfs\", module)\n sqlite3.vfs_register(vfs as any, false)\n }\n const db = yield* Effect.acquireRelease(\n Effect.try({\n try: () => sqlite3.open_v2(\":memory:\", undefined, \"memory-vfs\"),\n catch: (cause) => new SqlError({ cause, message: \"Failed to open database\" })\n }),\n (db) => Effect.sync(() => sqlite3.close(db))\n )\n\n if (options.installReactivityHooks) {\n sqlite3.update_hook(db, (_op, _db, table, rowid) => {\n if (!table) return\n const id = String(Number(rowid))\n reactivity.unsafeInvalidate({ [table]: [id] })\n })\n }\n\n const run = (\n sql: string,\n params: ReadonlyArray<unknown> = [],\n rowMode: \"object\" | \"array\" = \"object\"\n ) =>\n Effect.try({\n try: () => {\n const results: Array<any> = []\n for (const stmt of sqlite3.statements(db, sql)) {\n let columns: Array<string> | undefined\n sqlite3.bind_collection(stmt, params as any)\n while (sqlite3.step(stmt) === WaSqlite.SQLITE_ROW) {\n columns = columns ?? sqlite3.column_names(stmt)\n const row = sqlite3.row(stmt)\n if (rowMode === \"object\") {\n const obj: Record<string, any> = {}\n for (let i = 0; i < columns.length; i++) {\n obj[columns[i]] = row[i]\n }\n results.push(obj)\n } else {\n results.push(row)\n }\n }\n }\n return results\n },\n catch: (cause) => new SqlError({ cause, message: \"Failed to execute statement\" })\n })\n\n return identity<SqliteConnection>({\n execute(sql, params, transformRows) {\n return transformRows\n ? Effect.map(run(sql, params), transformRows)\n : run(sql, params)\n },\n executeRaw(sql, params) {\n return run(sql, params)\n },\n executeValues(sql, params) {\n return run(sql, params, \"array\")\n },\n executeUnprepared(sql, params, transformRows) {\n return this.execute(sql, params, transformRows)\n },\n executeStream(sql, params, transformRows) {\n function* stream() {\n for (const stmt of sqlite3.statements(db, sql)) {\n let columns: Array<string> | undefined\n sqlite3.bind_collection(stmt, params as any)\n while (sqlite3.step(stmt) === WaSqlite.SQLITE_ROW) {\n columns = columns ?? sqlite3.column_names(stmt)\n const row = sqlite3.row(stmt)\n const obj: Record<string, any> = {}\n for (let i = 0; i < columns.length; i++) {\n obj[columns[i]] = row[i]\n }\n yield obj\n }\n }\n }\n return Stream.suspend(() => Stream.fromIteratorSucceed(stream()[Symbol.iterator]())).pipe(\n transformRows\n ? Stream.mapChunks((chunk) => Chunk.unsafeFromArray(transformRows(Chunk.toReadonlyArray(chunk))))\n : identity,\n Stream.mapError((cause) => new SqlError({ cause, message: \"Failed to execute statement\" }))\n )\n },\n export: Effect.try({\n try: () => sqlite3.serialize(db, \"main\"),\n catch: (cause) => new SqlError({ cause, message: \"Failed to export database\" })\n }),\n import(data) {\n return Effect.try({\n try: () => sqlite3.deserialize(db, \"main\", data, data.length, data.length, 1 | 2),\n catch: (cause) => new SqlError({ cause, message: \"Failed to import database\" })\n })\n }\n })\n })\n\n const semaphore = yield* Effect.makeSemaphore(1)\n const connection = yield* makeConnection\n\n const acquirer = semaphore.withPermits(1)(Effect.succeed(connection))\n const transactionAcquirer = Effect.uninterruptibleMask((restore) =>\n Effect.as(\n Effect.zipRight(\n restore(semaphore.take(1)),\n Effect.tap(\n Effect.scope,\n (scope) => Scope.addFinalizer(scope, semaphore.release(1))\n )\n ),\n connection\n )\n )\n\n return Object.assign(\n (yield* Client.make({\n acquirer,\n compiler,\n transactionAcquirer,\n spanAttributes: [\n ...(options.spanAttributes ? Object.entries(options.spanAttributes) : []),\n [ATTR_DB_SYSTEM_NAME, \"sqlite\"]\n ],\n transformRows\n })) as SqliteClient,\n {\n [TypeId]: TypeId as TypeId,\n config: options,\n export: semaphore.withPermits(1)(connection.export),\n import(data: Uint8Array) {\n return semaphore.withPermits(1)(connection.import(data))\n }\n }\n )\n })\n\n/**\n * @category constructor\n * @since 1.0.0\n */\nexport const make = (\n options: SqliteClientConfig\n): Effect.Effect<SqliteClient, SqlError, Scope.Scope | Reactivity.Reactivity> =>\n Effect.gen(function*() {\n const reactivity = yield* Reactivity.Reactivity\n const compiler = Statement.makeCompilerSqlite(options.transformQueryNames)\n const transformRows = options.transformResultNames ?\n Statement.defaultTransforms(options.transformResultNames).array :\n undefined\n const pending = new Map<number, (effect: Exit.Exit<any, SqlError>) => void>()\n\n const makeConnection = Effect.gen(function*() {\n let currentId = 0\n const scope = yield* Effect.scope\n const readyDeferred = yield* Deferred.make<void>()\n\n const worker = yield* options.worker\n const port = \"port\" in worker ? worker.port : worker\n const postMessage = (message: OpfsWorkerMessage, transferables?: ReadonlyArray<any>) =>\n port.postMessage(message, transferables as any)\n\n yield* Scope.addFinalizer(scope, Effect.sync(() => postMessage([\"close\"])))\n\n const onMessage = (event: any) => {\n const [id, error, results] = event.data\n if (id === \"ready\") {\n Deferred.unsafeDone(readyDeferred, Exit.void)\n return\n } else if (id === \"update_hook\") {\n reactivity.unsafeInvalidate({ [error]: [results] })\n return\n } else {\n const resume = pending.get(id)\n if (!resume) return\n pending.delete(id)\n if (error) {\n resume(Exit.fail(new SqlError({ cause: error as string, message: \"Failed to execute statement\" })))\n } else {\n resume(Exit.succeed(results))\n }\n }\n }\n port.addEventListener(\"message\", onMessage)\n\n function onError() {\n Effect.runFork(ScopedRef.set(connectionRef, makeConnection))\n }\n if (\"onerror\" in worker) {\n worker.addEventListener(\"error\", onError)\n }\n\n yield* Scope.addFinalizer(\n scope,\n Effect.sync(() => {\n worker.removeEventListener(\"message\", onMessage)\n worker.removeEventListener(\"error\", onError)\n })\n )\n\n yield* Deferred.await(readyDeferred)\n\n if (options.installReactivityHooks) {\n postMessage([\"update_hook\"])\n }\n\n const send = (id: number, message: OpfsWorkerMessage, transferables?: ReadonlyArray<any>) =>\n Effect.async<any, SqlError>((resume) => {\n pending.set(id, resume)\n postMessage(message, transferables)\n })\n\n const run = (\n sql: string,\n params: ReadonlyArray<unknown> = [],\n rowMode: \"object\" | \"array\" = \"object\"\n ): Effect.Effect<Array<any>, SqlError, never> => {\n const rows = Effect.withFiberRuntime<[Array<string>, Array<any>], SqlError>((fiber) => {\n const id = currentId++\n return send(id, [id, sql, params], fiber.getFiberRef(currentTransferables))\n })\n return rowMode === \"object\"\n ? Effect.map(rows, extractObject)\n : Effect.map(rows, extractRows)\n }\n\n return identity<SqliteConnection>({\n execute(sql, params, transformRows) {\n return transformRows\n ? Effect.map(run(sql, params), transformRows)\n : run(sql, params)\n },\n executeRaw(sql, params) {\n return run(sql, params)\n },\n executeValues(sql, params) {\n return run(sql, params, \"array\")\n },\n executeUnprepared(sql, params, transformRows) {\n return this.execute(sql, params, transformRows)\n },\n executeStream() {\n return Effect.dieMessage(\"executeStream not implemented\")\n },\n export: Effect.suspend(() => {\n const id = currentId++\n return send(id, [\"export\", id])\n }),\n import(data) {\n return Effect.suspend(() => {\n const id = currentId++\n return send(id, [\"import\", id, data], [data.buffer])\n })\n }\n })\n })\n\n const connectionRef = yield* ScopedRef.fromAcquire(makeConnection)\n\n const semaphore = yield* Effect.makeSemaphore(1)\n const acquirer = semaphore.withPermits(1)(ScopedRef.get(connectionRef))\n const transactionAcquirer = Effect.uninterruptibleMask((restore) =>\n Effect.zipRight(\n Effect.zipRight(\n restore(semaphore.take(1)),\n Effect.tap(\n Effect.scope,\n (scope) => Scope.addFinalizer(scope, semaphore.release(1))\n )\n ),\n ScopedRef.get(connectionRef)\n )\n )\n\n return Object.assign(\n (yield* Client.make({\n acquirer,\n compiler,\n transactionAcquirer,\n spanAttributes: [\n ...(options.spanAttributes ? Object.entries(options.spanAttributes) : []),\n [ATTR_DB_SYSTEM_NAME, \"sqlite\"]\n ],\n transformRows\n })) as SqliteClient,\n {\n [TypeId]: TypeId as TypeId,\n config: options,\n export: Effect.flatMap(acquirer, (connection) => connection.export),\n import(data: Uint8Array) {\n return Effect.flatMap(acquirer, (connection) => connection.import(data))\n }\n }\n )\n })\n\nfunction rowToObject(columns: Array<string>, row: Array<any>) {\n const obj: Record<string, any> = {}\n for (let i = 0; i < columns.length; i++) {\n obj[columns[i]] = row[i]\n }\n return obj\n}\nconst extractObject = (rows: [Array<string>, Array<any>]) => rows[1].map((row) => rowToObject(rows[0], row))\nconst extractRows = (rows: [Array<string>, Array<any>]) => rows[1]\n\n/**\n * @category tranferables\n * @since 1.0.0\n */\nexport const currentTransferables: FiberRef.FiberRef<ReadonlyArray<Transferable>> = globalValue(\n \"@effect/sql-sqlite-wasm/currentTransferables\",\n () => FiberRef.unsafeMake<ReadonlyArray<Transferable>>([])\n)\n\n/**\n * @category tranferables\n * @since 1.0.0\n */\nexport const withTransferables =\n (transferables: ReadonlyArray<Transferable>) => <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>\n Effect.locally(effect, currentTransferables, transferables)\n\n/**\n * @category layers\n * @since 1.0.0\n */\nexport const layerMemoryConfig = (\n config: Config.Config.Wrap<SqliteClientMemoryConfig>\n): Layer.Layer<SqliteClient | Client.SqlClient, ConfigError | SqlError> =>\n Layer.scopedContext(\n Config.unwrap(config).pipe(\n Effect.flatMap(makeMemory),\n Effect.map((client) =>\n Context.make(SqliteClient, client).pipe(\n Context.add(Client.SqlClient, client)\n )\n )\n )\n ).pipe(Layer.provide(Reactivity.layer))\n\n/**\n * @category layers\n * @since 1.0.0\n */\nexport const layerMemory = (\n config: SqliteClientMemoryConfig\n): Layer.Layer<SqliteClient | Client.SqlClient, ConfigError | SqlError> =>\n Layer.scopedContext(\n Effect.map(makeMemory(config), (client) =>\n Context.make(SqliteClient, client).pipe(\n Context.add(Client.SqlClient, client)\n ))\n ).pipe(Layer.provide(Reactivity.layer))\n\n/**\n * @category layers\n * @since 1.0.0\n */\nexport const layer = (\n config: SqliteClientConfig\n): Layer.Layer<SqliteClient | Client.SqlClient, ConfigError | SqlError> =>\n Layer.scopedContext(\n Effect.map(make(config), (client) =>\n Context.make(SqliteClient, client).pipe(\n Context.add(Client.SqlClient, client)\n ))\n ).pipe(Layer.provide(Reactivity.layer))\n\n/**\n * @category layers\n * @since 1.0.0\n */\nexport const layerConfig = (\n config: Config.Config.Wrap<SqliteClientConfig>\n): Layer.Layer<SqliteClient | Client.SqlClient, ConfigError | SqlError> =>\n Layer.scopedContext(\n Config.unwrap(config).pipe(\n Effect.flatMap(make),\n Effect.map((client) =>\n Context.make(Sq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EjJ,KACzBqB,YAAW6H,kBAAWD,MAAM,CAAC,CACtC,CACF,CACF,EACDjJ,KAAWmJ,cAAmBpL,gBAAK,CAAC;",
6
+ "names": ["layer", "make", "Reactivity", "Client", "SqlError", "Statement", "WaSqlite", "SQLiteESMFactory", "MemoryVFS", "Chunk", "Config", "Context", "Deferred", "Effect", "Exit", "FiberRef", "identity", "globalValue", "Layer", "Scope", "ScopedRef", "Stream", "ATTR_DB_SYSTEM_NAME", "TypeId", "Symbol", "for", "SqliteClient", "GenericTag", "initModule", "runSync", "cached", "promise", "initEffect", "pipe", "map", "module", "Factory", "registered", "Set", "makeMemory", "options", "gen", "reactivity", "compiler", "makeCompilerSqlite", "transformQueryNames", "transformRows", "transformResultNames", "defaultTransforms", "array", "undefined", "makeConnection", "sqlite3", "has", "add", "vfs", "vfs_register", "db", "acquireRelease", "try", "open_v2", "catch", "cause", "message", "sync", "close", "installReactivityHooks", "update_hook", "_op", "_db", "table", "rowid", "id", "String", "Number", "unsafeInvalidate", "run", "sql", "params", "rowMode", "results", "stmt", "statements", "columns", "bind_collection", "step", "SQLITE_ROW", "column_names", "row", "obj", "i", "length", "push", "execute", "executeRaw", "executeValues", "executeUnprepared", "executeStream", "stream", "suspend", "fromIteratorSucceed", "iterator", "mapChunks", "chunk", "unsafeFromArray", "toReadonlyArray", "mapError", "export", "serialize", "import", "data", "deserialize", "semaphore", "makeSemaphore", "connection", "acquirer", "withPermits", "succeed", "transactionAcquirer", "uninterruptibleMask", "restore", "as", "zipRight", "take", "tap", "scope", "addFinalizer", "release", "Object", "assign", "spanAttributes", "entries", "config", "pending", "Map", "currentId", "readyDeferred", "worker", "port", "postMessage", "transferables", "onMessage", "event", "error", "unsafeDone", "void", "resume", "get", "delete", "fail", "addEventListener", "onError", "runFork", "set", "connectionRef", "removeEventListener", "await", "send", "async", "rows", "withFiberRuntime", "fiber", "getFiberRef", "currentTransferables", "extractObject", "extractRows", "dieMessage", "buffer", "fromAcquire", "flatMap", "rowToObject", "unsafeMake", "withTransferables", "effect", "locally", "layerMemoryConfig", "scopedContext", "unwrap", "client", "SqlClient", "provide", "layerMemory", "layerConfig"]
7
+ }
@@ -0,0 +1,17 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ OpfsWorker_exports
4
+ } from "./chunk-JOE7MZKS.mjs";
5
+ import {
6
+ SqliteMigrator_exports
7
+ } from "./chunk-JHEN2PHZ.mjs";
8
+ import {
9
+ SqliteClient_exports
10
+ } from "./chunk-L52WOGD2.mjs";
11
+ import "./chunk-2SZHAWBN.mjs";
12
+ export {
13
+ OpfsWorker_exports as OpfsWorker,
14
+ SqliteClient_exports as SqliteClient,
15
+ SqliteMigrator_exports as SqliteMigrator
16
+ };
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/OpfsWorker.js":{"bytes":3283,"imports":[{"path":"@effect/sql/SqlError","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite/dist/wa-sqlite.mjs","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite/src/examples/AccessHandlePoolVFS.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true}],"format":"esm"},"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteClient.js":{"bytes":12662,"imports":[{"path":"@effect/experimental/Reactivity","kind":"import-statement","external":true},{"path":"@effect/sql/SqlClient","kind":"import-statement","external":true},{"path":"@effect/sql/SqlError","kind":"import-statement","external":true},{"path":"@effect/sql/Statement","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite/dist/wa-sqlite.mjs","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite/src/examples/MemoryVFS.js","kind":"import-statement","external":true},{"path":"effect/Chunk","kind":"import-statement","external":true},{"path":"effect/Config","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Deferred","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Exit","kind":"import-statement","external":true},{"path":"effect/FiberRef","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"effect/GlobalValue","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Scope","kind":"import-statement","external":true},{"path":"effect/ScopedRef","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true}],"format":"esm"},"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteMigrator.js":{"bytes":433,"imports":[{"path":"@effect/sql/Migrator","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"@effect/sql/Migrator","kind":"import-statement","external":true}],"format":"esm"},"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/index.js":{"bytes":258,"imports":[{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/OpfsWorker.js","kind":"import-statement","original":"./OpfsWorker.js"},{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteClient.js","kind":"import-statement","original":"./SqliteClient.js"},{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteMigrator.js","kind":"import-statement","original":"./SqliteMigrator.js"}],"format":"esm"},"src/index.ts":{"bytes":1176,"imports":[{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/index.js","kind":"import-statement","original":"@effect/sql-sqlite-wasm"},{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/OpfsWorker.js","kind":"import-statement","original":"@effect/sql-sqlite-wasm/OpfsWorker"},{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteClient.js","kind":"import-statement","original":"@effect/sql-sqlite-wasm/SqliteClient"},{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteMigrator.js","kind":"import-statement","original":"@effect/sql-sqlite-wasm/SqliteMigrator"}],"format":"esm"},"src/SqliteClient.ts":{"bytes":534,"imports":[{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteClient.js","kind":"import-statement","original":"@effect/sql-sqlite-wasm/SqliteClient"}],"format":"esm"},"src/OpfsWorker.ts":{"bytes":526,"imports":[{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/OpfsWorker.js","kind":"import-statement","original":"@effect/sql-sqlite-wasm/OpfsWorker"}],"format":"esm"},"src/SqliteMigrator.ts":{"bytes":542,"imports":[{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteMigrator.js","kind":"import-statement","original":"@effect/sql-sqlite-wasm/SqliteMigrator"}],"format":"esm"},"src/SqlExport.ts":{"bytes":1079,"imports":[{"path":"effect/Context","kind":"import-statement","external":true}],"format":"esm"},"src/SqlTransaction.ts":{"bytes":3893,"imports":[{"path":"@effect/sql/SqlClient","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true}],"format":"esm"},"src/platform/node.ts":{"bytes":2827,"imports":[{"path":"@effect/sql-sqlite-node/SqliteClient","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"src/SqlExport.ts","kind":"import-statement","original":"../SqlExport"}],"format":"esm"},"src/platform/browser.ts":{"bytes":2702,"imports":[{"path":"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteClient.js","kind":"import-statement","original":"@effect/sql-sqlite-wasm/SqliteClient"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"src/SqlExport.ts","kind":"import-statement","original":"../SqlExport"}],"format":"esm"},"src/platform/bun.ts":{"bytes":2853,"imports":[{"path":"@effect/sql-sqlite-bun/SqliteClient","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"src/SqlExport.ts","kind":"import-statement","original":"../SqlExport"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/platform/bun.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1579},"dist/lib/node-esm/platform/bun.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-B2CW3GJX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"},{"path":"@effect/sql-sqlite-bun/SqliteClient","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true}],"exports":["layerMemory","sqlExportLayer"],"entryPoint":"src/platform/bun.ts","inputs":{"src/platform/bun.ts":{"bytesInOutput":419}},"bytes":697},"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-JOE7MZKS.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-JHEN2PHZ.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-L52WOGD2.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"}],"exports":["OpfsWorker","SqliteClient","SqliteMigrator"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":478},"dist/lib/node-esm/SqliteClient.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/SqliteClient.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-L52WOGD2.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"}],"exports":["SqliteClient","TypeId","currentTransferables","layer","layerConfig","layerMemory","layerMemoryConfig","make","makeMemory","withTransferables"],"entryPoint":"src/SqliteClient.ts","inputs":{"src/SqliteClient.ts":{"bytesInOutput":0}},"bytes":521},"dist/lib/node-esm/OpfsWorker.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/OpfsWorker.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-JOE7MZKS.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"}],"exports":["run"],"entryPoint":"src/OpfsWorker.ts","inputs":{"src/OpfsWorker.ts":{"bytesInOutput":0}},"bytes":227},"dist/lib/node-esm/chunk-JOE7MZKS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6847},"dist/lib/node-esm/chunk-JOE7MZKS.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"},{"path":"@effect/sql/SqlError","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite/dist/wa-sqlite.mjs","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite/src/examples/AccessHandlePoolVFS.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true}],"exports":["OpfsWorker_exports","run"],"inputs":{"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/OpfsWorker.js":{"bytesInOutput":3066}},"bytes":3507},"dist/lib/node-esm/SqliteMigrator.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":307},"dist/lib/node-esm/SqliteMigrator.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-JHEN2PHZ.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"}],"exports":["layer","run"],"entryPoint":"src/SqliteMigrator.ts","inputs":{"src/SqliteMigrator.ts":{"bytesInOutput":174}},"bytes":509},"dist/lib/node-esm/chunk-JHEN2PHZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1406},"dist/lib/node-esm/chunk-JHEN2PHZ.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"},{"path":"@effect/sql/Migrator","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"@effect/sql/Migrator","kind":"import-statement","external":true}],"exports":["SqliteMigrator_exports","layer","run"],"inputs":{"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteMigrator.js":{"bytesInOutput":411}},"bytes":883},"dist/lib/node-esm/SqlExport.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/SqlExport.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-B2CW3GJX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"}],"exports":["SqlExport"],"entryPoint":"src/SqlExport.ts","inputs":{},"bytes":238},"dist/lib/node-esm/SqlTransaction.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1961},"dist/lib/node-esm/SqlTransaction.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"},{"path":"@effect/sql/SqlClient","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true}],"exports":["SqlTransaction","layer"],"entryPoint":"src/SqlTransaction.ts","inputs":{"src/SqlTransaction.ts":{"bytesInOutput":410}},"bytes":641},"dist/lib/node-esm/platform/node.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1559},"dist/lib/node-esm/platform/node.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-B2CW3GJX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"},{"path":"@effect/sql-sqlite-node/SqliteClient","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true}],"exports":["layerMemory","sqlExportLayer"],"entryPoint":"src/platform/node.ts","inputs":{"src/platform/node.ts":{"bytesInOutput":420}},"bytes":700},"dist/lib/node-esm/platform/browser.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1445},"dist/lib/node-esm/platform/browser.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-L52WOGD2.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-B2CW3GJX.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true}],"exports":["layerMemory","sqlExportLayer"],"entryPoint":"src/platform/browser.ts","inputs":{"src/platform/browser.ts":{"bytesInOutput":307}},"bytes":680},"dist/lib/node-esm/chunk-L52WOGD2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":28263},"dist/lib/node-esm/chunk-L52WOGD2.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2SZHAWBN.mjs","kind":"import-statement"},{"path":"@effect/experimental/Reactivity","kind":"import-statement","external":true},{"path":"@effect/sql/SqlClient","kind":"import-statement","external":true},{"path":"@effect/sql/SqlError","kind":"import-statement","external":true},{"path":"@effect/sql/Statement","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite/dist/wa-sqlite.mjs","kind":"import-statement","external":true},{"path":"@dxos/wa-sqlite/src/examples/MemoryVFS.js","kind":"import-statement","external":true},{"path":"effect/Chunk","kind":"import-statement","external":true},{"path":"effect/Config","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Deferred","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Exit","kind":"import-statement","external":true},{"path":"effect/FiberRef","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"effect/GlobalValue","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Scope","kind":"import-statement","external":true},{"path":"effect/ScopedRef","kind":"import-statement","external":true},{"path":"effect/Stream","kind":"import-statement","external":true}],"exports":["SqliteClient","SqliteClient_exports","TypeId","currentTransferables","layer","layerConfig","layerMemory","layerMemoryConfig","make","makeMemory","withTransferables"],"inputs":{"../../../node_modules/.pnpm/@effect+sql-sqlite-wasm@0.49.0_@effect+experimental@0.57.11_@effect+platform@0.93.6_eff_5dda6e19dc5be2cebf423b5c755af0d4/node_modules/@effect/sql-sqlite-wasm/dist/esm/SqliteClient.js":{"bytesInOutput":12559}},"bytes":13169},"dist/lib/node-esm/chunk-B2CW3GJX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":597},"dist/lib/node-esm/chunk-B2CW3GJX.mjs":{"imports":[{"path":"effect/Context","kind":"import-statement","external":true}],"exports":["SqlExport"],"inputs":{"src/SqlExport.ts":{"bytesInOutput":122}},"bytes":304},"dist/lib/node-esm/chunk-2SZHAWBN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/chunk-2SZHAWBN.mjs":{"imports":[],"exports":["__export","__reExport"],"inputs":{},"bytes":1013}}}
@@ -0,0 +1,25 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ SqliteClient,
4
+ layerMemory
5
+ } from "../chunk-L52WOGD2.mjs";
6
+ import {
7
+ SqlExport
8
+ } from "../chunk-B2CW3GJX.mjs";
9
+ import "../chunk-2SZHAWBN.mjs";
10
+
11
+ // src/platform/browser.ts
12
+ import * as Effect from "effect/Effect";
13
+ import * as Layer from "effect/Layer";
14
+ var sqlExportLayer = Layer.effect(SqlExport, Effect.gen(function* () {
15
+ const sql = yield* SqliteClient;
16
+ return {
17
+ export: sql.export
18
+ };
19
+ }));
20
+ var layerMemory2 = sqlExportLayer.pipe(Layer.provideMerge(layerMemory({})));
21
+ export {
22
+ layerMemory2 as layerMemory,
23
+ sqlExportLayer
24
+ };
25
+ //# sourceMappingURL=browser.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/platform/browser.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as SqlClient from '@effect/sql/SqlClient';\nimport type * as SqlError from '@effect/sql/SqlError';\nimport * as SqliteClient from '@effect/sql-sqlite-wasm/SqliteClient';\nimport type * as ConfigError from 'effect/ConfigError';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport * as SqlExport from '../SqlExport';\n\nexport const sqlExportLayer: Layer.Layer<SqlExport.SqlExport, SqlError.SqlError, SqliteClient.SqliteClient> =\n Layer.effect(\n SqlExport.SqlExport,\n Effect.gen(function* () {\n const sql = yield* SqliteClient.SqliteClient;\n return {\n export: sql.export,\n } satisfies SqlExport.Service;\n }),\n );\n\nexport const layerMemory: Layer.Layer<\n SqlClient.SqlClient | SqlExport.SqlExport,\n ConfigError.ConfigError | SqlError.SqlError\n> = sqlExportLayer.pipe(Layer.provideMerge(SqliteClient.layerMemory({})));\n"],
5
+ "mappings": ";;;;;;;;;;;AAQA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AAIhB,IAAMC,iBACLC,aACMC,WACHC,WAAI,aAAA;AACT,QAAMC,MAAM,OAAoBC;AAChC,SAAO;IACLC,QAAQF,IAAIE;EACd;AACF,CAAA,CAAA;AAGG,IAAMC,eAGTP,eAAeQ,KAAWC,mBAA0BF,YAAY,CAAC,CAAA,CAAA,CAAA;",
6
+ "names": ["Effect", "Layer", "sqlExportLayer", "effect", "SqlExport", "gen", "sql", "SqliteClient", "export", "layerMemory", "pipe", "provideMerge"]
7
+ }