@streamsy/storage 0.0.0-stage → 0.4.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Gareth Andrew
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,135 @@
1
- # Temporary Holding Version
1
+ # @streamsy/storage
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ SQL storage for `@streamsy/core`, built on Effect SQL. One entry for Bun
4
+ SQLite, one for SQLite Durable Objects, and a driver-free root for your own
5
+ SQLite or Postgres `SqlClient`. Version 0.4.0 requires `effect@4.0.1`.
6
+
7
+ ```sh
8
+ bun add @streamsy/storage @streamsy/core effect
9
+ ```
10
+
11
+ ## Entries
12
+
13
+ | Entry | Use it for |
14
+ | ---------------------------------- | -------------------------------------------------------------------------------- |
15
+ | `@streamsy/storage/bun` | A retained SQLite file on Bun (`@effect/sql-sqlite-bun`, `@effect/platform-bun`) |
16
+ | `@streamsy/storage/durable-object` | SQLite inside a Cloudflare Durable Object (`@effect/sql-sqlite-do`) |
17
+ | `@streamsy/storage` | A SQLite (3.42 or newer), Postgres or MySQL `SqlClient` you provide |
18
+
19
+ The Bun and Durable Object entries export `BunStorage` and
20
+ `DurableObjectStorage`, each with `layer` and `layerProtocol`.
21
+ `layerProtocol` exposes `StreamsReader`, `StreamsWriter`, `Storage`,
22
+ `CommitBoundary`, `SqlClient`, and SQL reactivity on both hosts. Your own SQL
23
+ can share the connection and commit with a stream mutation. `layer` exposes
24
+ the same storage services without the protocol reader and writer. The root entry
25
+ exports `SqlStorage`, with `layer` over a `SqlClient` you supply and
26
+ `clientLayer` to provide one.
27
+ `CommitBoundary` comes from `@streamsy/core`.
28
+
29
+ ## Use your own client
30
+
31
+ `SqlStorage.clientLayer` builds a client from its `make` function and provides it with the
32
+ `Reactivity` it captured, so the client and the storage share one change graph.
33
+ The root entry imports no driver. Add the one you use, at `4.0.1`.
34
+
35
+ ```ts
36
+ import { Layer, Redacted } from "effect";
37
+ import { PgClient } from "@effect/sql-pg";
38
+ import { SqlStorage } from "@streamsy/storage";
39
+
40
+ const storage = SqlStorage.layer(streams).pipe(
41
+ Layer.provide(SqlStorage.clientLayer(PgClient.make({ url: Redacted.make(url) }))),
42
+ );
43
+ ```
44
+
45
+ On Postgres and MySQL, every mutation transaction first locks the rows of the
46
+ streams it writes (`SELECT ... FOR UPDATE`), so writers on many connections or
47
+ processes apply one after the other.
48
+
49
+ ## Serve a SQLite-backed host on Bun
50
+
51
+ ```ts
52
+ import { Layer } from "effect";
53
+ import { HttpRouter } from "effect/http";
54
+ import { BunRuntime } from "@effect/platform-bun";
55
+ import { Http, Streamsy } from "@streamsy/core";
56
+ import { listener } from "@streamsy/serve/bun";
57
+ import { BunStorage } from "@streamsy/storage/bun";
58
+
59
+ const streams = Streamsy.group(Streamsy.Wildcard);
60
+ const Server = HttpRouter.serve(Http.routes(streams, { prefix: "/streams", access: "full" })).pipe(
61
+ Layer.provide(BunStorage.layer(streams, { client: { filename: "./streams.sqlite" } })),
62
+ Layer.provide(listener({ port: 3000 })),
63
+ );
64
+ BunRuntime.runMain(Layer.launch(Server));
65
+ ```
66
+
67
+ ## Commit your SQL with a stream write
68
+
69
+ `CommitBoundary.withTransaction` from `@streamsy/core` runs application SQL and Streamsy mutations
70
+ in one transaction. Nested calls join the outer boundary. A rejected mutation
71
+ fails with `MutationRejected` and rolls the transaction back; catch it outside
72
+ the boundary. The [Layers and storage guide](https://streamsy.dev/docs/hosting)
73
+ shows the complete pattern.
74
+
75
+ On a server database, the stream row lock is taken by the first stream mutation
76
+ inside the transaction, not when the transaction starts. Your SQL before that
77
+ mutation runs before the lock. Storage's reads inside a mutation are safe on
78
+ every dialect: on MySQL they are locking reads (`FOR UPDATE` or `FOR SHARE`),
79
+ so they see the latest committed rows even when your SQL fixed the
80
+ transaction's snapshot first. A stale plan is rejected, never written.
81
+
82
+ The protocol plans an append from `storage.record` and `storage.producer`.
83
+ Inside a transaction on MySQL, these reads are `FOR UPDATE` too, so each replan
84
+ sees the latest tail and the stream row stays locked until your transaction
85
+ ends. Other writers to that stream wait for your commit. Outside a transaction
86
+ they are plain reads and take no lock.
87
+
88
+ Your reads of your own tables are your job. On Postgres each statement reads
89
+ the latest committed rows. On MySQL at the default REPEATABLE READ, a plain
90
+ read uses the snapshot of the transaction's first plain read, which can be
91
+ older than the stream lock. If a decision depends on a row another writer can
92
+ change, read it with `FOR UPDATE` or `FOR SHARE` on MySQL.
93
+
94
+ For a projection on that same connection:
95
+
96
+ ```ts
97
+ import { Layer } from "effect";
98
+ import { CheckpointStore, Transaction } from "@streamsy/projection";
99
+ import { BunStorage } from "@streamsy/storage/bun";
100
+
101
+ const host = Layer.mergeAll(CheckpointStore.layer, Transaction.layer).pipe(
102
+ Layer.provideMerge(BunStorage.layerProtocol({ client: { filename: "./streamsy.sqlite" } })),
103
+ );
104
+ ```
105
+
106
+ `CheckpointStore.layer` keeps checkpoints in the storage table
107
+ `streamsy_owner_records`. On Postgres and MySQL, a checkpoint save locks the
108
+ record it read, and a first save is a plain insert, so two concurrent saves of
109
+ one projection never both win. `Transaction.layer` gives the SQL-only `Transaction`
110
+ service. `Commit.transaction` uses them to commit SQL, same-owner stream
111
+ appends, and the checkpoint together.
112
+
113
+ In a Durable Object, use `DurableObjectStorage.layerProtocol` with
114
+ `client: { storage: ctx.storage }` in the same composition.
115
+
116
+ ## Good to know
117
+
118
+ - The Bun entry creates the parent folder of a new file. A read-only open, or
119
+ `create: false`, creates nothing.
120
+ - Only files in the current storage format are accepted. Older Streamsy files,
121
+ including those from earlier 0.4 builds, and newer unknown schemas are
122
+ rejected without being changed. Use a fresh database path.
123
+ - Stream ids are limited to 512 characters, and producer ids to 255. A longer
124
+ id fails with a non-retryable `StorageFault` before anything is written.
125
+ - Bun defaults the client `busyTimeout` to zero and retries storage-owned
126
+ transactions with a bounded yielding policy. Tune `client.busyTimeout`,
127
+ `transactionRetryAttempts`, and `transactionRetryDelayMs` if you need to.
128
+ - Long-poll reads default to 30 seconds on Bun and 25 seconds in a Durable
129
+ Object.
130
+ - Change notifications are process-local. A repair pass every `repairIntervalMs`
131
+ (default 1,000 ms) bounds staleness across processes.
132
+
133
+ ## License
134
+
135
+ MIT
package/dist/bun.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { r as SqlStorageOptions } from "./storage-CrMmTyyG.js";
2
+ import { Layer } from "effect";
3
+ import { StorageFault, Streamsy } from "@streamsy/core";
4
+ import { Protocol } from "@streamsy/core/protocol";
5
+ import { SqliteClient } from "@effect/sql-sqlite-bun";
6
+ declare namespace bun_storage_d_exports {
7
+ export { Options, layer, layerProtocol };
8
+ }
9
+ interface BunStorageOptions extends SqlStorageOptions {
10
+ readonly client: Parameters<typeof SqliteClient.make>[0];
11
+ }
12
+ /** Options for `layer` and `layerProtocol`. */
13
+ interface Options extends BunStorageOptions, Protocol.ProtocolOptions {}
14
+ /** Official Bun SQLite host layer with one shared SqlClient/Reactivity graph. */
15
+ declare const storageLayer: (options: BunStorageOptions) => Layer.Layer<import("@streamsy/core").CommitBoundary | import("@streamsy/core/internal").OwnerRecords | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | import("@streamsy/core").Storage, StorageFault, never>;
16
+ /** Complete persistent protocol Layer for an HttpRouter application. */
17
+ declare const layerProtocol: (options: Options) => Layer.Layer<import("@streamsy/core").CommitBoundary | import("@streamsy/core/internal").OwnerRecords | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | import("@streamsy/core").Storage | import("@streamsy/core/protocol").StreamsReader | import("@streamsy/core/protocol").StreamsWriter, StorageFault, never>;
18
+ declare function layer<const Keys extends ReadonlyArray<Streamsy.Any>>(group: Streamsy.Group<Keys>, options: Options): Layer.Layer<Layer.Success<ReturnType<typeof storageLayer>> | Streamsy.Host<Streamsy.Group<Keys>>, Layer.Error<ReturnType<typeof storageLayer>>>;
19
+ //#endregion
20
+ export { bun_storage_d_exports as BunStorage };
package/dist/bun.js ADDED
@@ -0,0 +1,109 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
+ import { a as storageLayer$1, d as retryWithPolicy, f as transactionRetryPolicy, o as inspectFormat, s as newerVersionFault, u as sharedSqlClientLayer } from "./storage-CpnFxwO5.js";
3
+ import { Cause, Effect, FileSystem, Layer, Option, Path, Result, Schema } from "effect";
4
+ import { StorageFault } from "@streamsy/core";
5
+ import { Protocol } from "@streamsy/core/protocol";
6
+ import * as BunFileSystem from "@effect/platform-bun/BunFileSystem";
7
+ import * as BunPath from "@effect/platform-bun/BunPath";
8
+ import { SqliteClient } from "@effect/sql-sqlite-bun";
9
+ import { Database } from "bun:sqlite";
10
+ //#region src/sqlite-file.ts
11
+ const openFault$1 = (message) => new StorageFault({
12
+ operation: "migration.open",
13
+ message,
14
+ retryable: false
15
+ });
16
+ const decodeTableNames = Schema.decodeUnknownSync(Schema.Array(Schema.Struct({ name: Schema.String })));
17
+ const decodeVersions = Schema.decodeUnknownSync(Schema.Array(Schema.Struct({ version: Schema.NullOr(Schema.Finite) })));
18
+ const readFormat = (reader) => {
19
+ const names = new Set(decodeTableNames(reader.all("SELECT name FROM sqlite_master WHERE type='table'")).map(({ name }) => name));
20
+ return {
21
+ names,
22
+ version: names.has("streamsy_schema") ? decodeVersions(reader.all(`SELECT MAX(version) version FROM streamsy_schema`)).at(0)?.version ?? 0 : 0
23
+ };
24
+ };
25
+ /** The same format rule as the SQL migration runner, read before the client opens the file. */
26
+ const preflight = (filename, driver, retry) => Effect.gen(function* () {
27
+ const state = yield* retryWithPolicy(driver.read(filename, readFormat), retry, (error) => error.retryable);
28
+ yield* inspectFormat(state.names);
29
+ if (state.version > 1) return yield* newerVersionFault(state.version);
30
+ });
31
+ /**
32
+ * Prepare a SQLite file before the client opens it: create the parent folder,
33
+ * refuse a foreign format, check the open mode, and set WAL with busy timeout 0.
34
+ * A read-only or no-create open never creates a folder or a file.
35
+ */
36
+ const prepare = (driver, options, retry) => Effect.gen(function* () {
37
+ const { filename } = options;
38
+ if (filename === ":memory:") return;
39
+ const fs = yield* FileSystem.FileSystem;
40
+ const path = yield* Path.Path;
41
+ const readonly = options.readonly === true;
42
+ const mode = {
43
+ readonly,
44
+ readwrite: readonly ? false : options.readwrite ?? true,
45
+ create: readonly ? false : options.create ?? true
46
+ };
47
+ if (mode.readwrite && mode.create) yield* fs.makeDirectory(path.dirname(filename), { recursive: true }).pipe(Effect.mapError((error) => openFault$1(`Cannot create the folder for SQLite file ${filename}: ${error.message}`)));
48
+ if (yield* fs.exists(filename).pipe(Effect.mapError((error) => openFault$1(`Cannot check SQLite file ${filename}: ${error.message}`)))) yield* preflight(filename, driver, retry);
49
+ const retried = (step) => retryWithPolicy(step, retry, (error) => error.retryable);
50
+ yield* retried(driver.run(filename, mode, []));
51
+ if (!readonly && options.disableWAL !== true) yield* retried(driver.run(filename, {
52
+ readonly: false,
53
+ readwrite: options.readwrite ?? true,
54
+ create: options.create ?? true
55
+ }, ["PRAGMA busy_timeout=0", "PRAGMA journal_mode=WAL"]));
56
+ });
57
+ //#endregion
58
+ //#region src/bun-storage.ts
59
+ var bun_storage_exports = /* @__PURE__ */ __exportAll({
60
+ layer: () => layer,
61
+ layerProtocol: () => layerProtocol
62
+ });
63
+ const SqliteOpenError = Schema.Struct({
64
+ code: Schema.optional(Schema.String),
65
+ errno: Schema.optional(Schema.Finite)
66
+ });
67
+ const decodeSqliteOpenError = Schema.decodeUnknownOption(SqliteOpenError);
68
+ const isBusy = ({ code, errno }) => code === "SQLITE_BUSY" || code === "SQLITE_LOCKED" || errno === 5 || errno === 6;
69
+ const isSqliteOperationalError = ({ code, errno }) => (code?.startsWith("SQLITE_") ?? false) || errno !== void 0;
70
+ const openFault = (error, rendered) => new StorageFault({
71
+ operation: "migration.open",
72
+ message: rendered,
73
+ retryable: isBusy(error)
74
+ });
75
+ const normalizeSqliteDefect = (acquisition) => acquisition.pipe(Effect.catch((error) => Effect.die(error.reason.cause)), Effect.catchCause((cause) => Result.match(Cause.findDefect(cause), {
76
+ onFailure: () => Effect.failCause(cause),
77
+ onSuccess: (defect) => Option.match(decodeSqliteOpenError(defect), {
78
+ onNone: () => Effect.failCause(cause),
79
+ onSome: (error) => isSqliteOperationalError(error) ? Effect.fail(openFault(error, String(defect))) : Effect.failCause(cause)
80
+ })
81
+ })));
82
+ /** Raw `bun:sqlite` opens for the shared SQLite file step. */
83
+ const bunDriver = {
84
+ read: (filename, use) => Effect.acquireUseRelease(normalizeSqliteDefect(Effect.sync(() => new Database(filename, { readonly: true }))), (database) => normalizeSqliteDefect(Effect.sync(() => use({ all: (sql) => database.query(sql).all() }))), (database) => Effect.sync(() => database.close(false))),
85
+ run: (filename, mode, statements) => Effect.acquireUseRelease(normalizeSqliteDefect(Effect.sync(() => new Database(filename, mode))), (database) => normalizeSqliteDefect(Effect.sync(() => {
86
+ for (const statement of statements) database.run(statement);
87
+ })), (database) => Effect.sync(() => database.close(false)))
88
+ };
89
+ const BunPlatform = Layer.mergeAll(BunFileSystem.layer, BunPath.layer);
90
+ /** Official Bun SQLite host layer with one shared SqlClient/Reactivity graph. */
91
+ const storageLayer = (options) => {
92
+ const retryPolicy = transactionRetryPolicy(options);
93
+ const preparesJournal = options.client.filename !== ":memory:" && options.client.readonly !== true && options.client.disableWAL !== true;
94
+ const clientLayer = Layer.effectContext(sharedSqlClientLayer(normalizeSqliteDefect(SqliteClient.make({
95
+ busyTimeout: 0,
96
+ ...options.client,
97
+ disableWAL: preparesJournal ? true : options.client.disableWAL
98
+ }))));
99
+ return Layer.unwrap(prepare(bunDriver, options.client, retryPolicy).pipe(Effect.as(storageLayer$1(options).pipe(Layer.provideMerge(clientLayer))))).pipe(Layer.provide(BunPlatform));
100
+ };
101
+ /** Complete persistent protocol Layer for an HttpRouter application. */
102
+ const layerProtocol = (options) => Protocol.layer(options).pipe(Layer.provideMerge(storageLayer(options)));
103
+ function layer(group, options) {
104
+ const storage = storageLayer(options);
105
+ const protocol = Protocol.layer(options).pipe(Layer.provideMerge(storage));
106
+ return Protocol.bind(protocol, group).pipe(Layer.provideMerge(storage));
107
+ }
108
+ //#endregion
109
+ export { bun_storage_exports as BunStorage };
@@ -0,0 +1,24 @@
1
+ import { r as SqlStorageOptions } from "./storage-CrMmTyyG.js";
2
+ import { Layer } from "effect";
3
+ import { Streamsy } from "@streamsy/core";
4
+ import { Protocol } from "@streamsy/core/protocol";
5
+ import { SqliteClient } from "@effect/sql-sqlite-do";
6
+ declare namespace durable_object_storage_d_exports {
7
+ export { DEFAULT_LONG_POLL_TIMEOUT_MS, Options, layer, layerProtocol };
8
+ }
9
+ interface DurableObjectStorageOptions extends SqlStorageOptions {
10
+ /** Full DurableObjectStorage is required because Storage mutations are transactional. */
11
+ readonly client: Parameters<typeof SqliteClient.make>[0] & {
12
+ readonly storage: NonNullable<Parameters<typeof SqliteClient.make>[0]["storage"]>;
13
+ };
14
+ }
15
+ declare const DEFAULT_LONG_POLL_TIMEOUT_MS = 25000;
16
+ /** Options for `layer` and `layerProtocol`. */
17
+ interface Options extends DurableObjectStorageOptions, Protocol.ProtocolOptions {}
18
+ /** Official local/host Durable Object SQLite layer with commit-boundary support. */
19
+ declare const storageLayer: (options: DurableObjectStorageOptions) => Layer.Layer<import("@streamsy/core").CommitBoundary | import("@streamsy/core/internal").OwnerRecords | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | import("@streamsy/core").Storage, import("@streamsy/core").StorageFault, never>;
20
+ /** Protocol over the official Durable Object SQLite layer. */
21
+ declare const layerProtocol: (options: Options) => Layer.Layer<import("@streamsy/core").CommitBoundary | import("@streamsy/core/internal").OwnerRecords | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | import("@streamsy/core").Storage | import("@streamsy/core/protocol").StreamsReader | import("@streamsy/core/protocol").StreamsWriter, import("@streamsy/core").StorageFault, never>;
22
+ declare function layer<const Keys extends ReadonlyArray<Streamsy.Any>>(group: Streamsy.Group<Keys>, options: Options): Layer.Layer<Layer.Success<ReturnType<typeof storageLayer>> | Streamsy.Host<Streamsy.Group<Keys>>, Layer.Error<ReturnType<typeof storageLayer>>>;
23
+ //#endregion
24
+ export { durable_object_storage_d_exports as DurableObjectStorage };
@@ -0,0 +1,33 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
+ import { i as layerWithDurableObjectTransactions, u as sharedSqlClientLayer } from "./storage-CpnFxwO5.js";
3
+ import { Layer } from "effect";
4
+ import "@streamsy/core";
5
+ import { Protocol } from "@streamsy/core/protocol";
6
+ import { SqliteClient } from "@effect/sql-sqlite-do";
7
+ //#region src/durable-object-storage.ts
8
+ var durable_object_storage_exports = /* @__PURE__ */ __exportAll({
9
+ DEFAULT_LONG_POLL_TIMEOUT_MS: () => DEFAULT_LONG_POLL_TIMEOUT_MS,
10
+ layer: () => layer,
11
+ layerProtocol: () => layerProtocol
12
+ });
13
+ const DEFAULT_LONG_POLL_TIMEOUT_MS = 25e3;
14
+ /** Official local/host Durable Object SQLite layer with commit-boundary support. */
15
+ const storageLayer = (options) => {
16
+ const clientLayer = Layer.effectContext(sharedSqlClientLayer(SqliteClient.make(options.client)));
17
+ return layerWithDurableObjectTransactions(options).pipe(Layer.provideMerge(clientLayer));
18
+ };
19
+ /** Protocol over the official Durable Object SQLite layer. */
20
+ const layerProtocol = (options) => Protocol.layer({
21
+ ...options,
22
+ longPollTimeoutMs: options.longPollTimeoutMs ?? 25e3
23
+ }).pipe(Layer.provideMerge(storageLayer(options)));
24
+ function layer(group, options) {
25
+ const storage = storageLayer(options);
26
+ const protocol = Protocol.layer({
27
+ ...options,
28
+ longPollTimeoutMs: options.longPollTimeoutMs ?? 25e3
29
+ }).pipe(Layer.provideMerge(storage));
30
+ return Protocol.bind(protocol, group).pipe(Layer.provideMerge(storage));
31
+ }
32
+ //#endregion
33
+ export { durable_object_storage_exports as DurableObjectStorage };
@@ -0,0 +1,6 @@
1
+ import { a as layerProtocol, c as DEFAULT_TRANSACTION_RETRY_DELAY_MS, i as layer, n as Options, o as clientLayer, s as DEFAULT_TRANSACTION_RETRY_ATTEMPTS, t as DEFAULT_REPAIR_INTERVAL_MS } from "./storage-CrMmTyyG.js";
2
+ declare namespace sql_storage_d_exports {
3
+ export { DEFAULT_REPAIR_INTERVAL_MS, DEFAULT_TRANSACTION_RETRY_ATTEMPTS, DEFAULT_TRANSACTION_RETRY_DELAY_MS, Options, clientLayer, layer, layerProtocol };
4
+ }
5
+ //#endregion
6
+ export { sql_storage_d_exports as SqlStorage };
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
+ import { l as clientLayer, n as layer, r as layerProtocol, t as DEFAULT_REPAIR_INTERVAL_MS } from "./storage-CpnFxwO5.js";
3
+ //#region src/sql-storage.ts
4
+ var sql_storage_exports = /* @__PURE__ */ __exportAll({
5
+ DEFAULT_REPAIR_INTERVAL_MS: () => DEFAULT_REPAIR_INTERVAL_MS,
6
+ DEFAULT_TRANSACTION_RETRY_ATTEMPTS: () => 16,
7
+ DEFAULT_TRANSACTION_RETRY_DELAY_MS: () => 25,
8
+ clientLayer: () => clientLayer,
9
+ layer: () => layer,
10
+ layerProtocol: () => layerProtocol
11
+ });
12
+ //#endregion
13
+ export { sql_storage_exports as SqlStorage };
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };