@rotorsoft/act-sqlite 1.22.2 → 1.22.4

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.
@@ -126,37 +126,12 @@ export declare function streamPatternToGlob(input: string): string;
126
126
  */
127
127
  export declare class SqliteStore implements Store {
128
128
  private client;
129
- /**
130
- * Memoized key resolver for the optional `pii_encryption` envelope.
131
- * Initialized in the constructor when encryption is configured;
132
- * `undefined` otherwise. The resolver caches the operator's key on
133
- * first use — rotation means restarting the store with a fresh
134
- * provider.
135
- */
136
129
  private readonly _resolve_pii_key;
137
130
  constructor(config: SqliteConfig);
138
- /**
139
- * Write-side pii encoder: encrypts when `pii_encryption` is configured,
140
- * stringifies for the TEXT column either way. `null` passes through so
141
- * `forget_pii` semantics survive intact (the row format skips the
142
- * column entirely on a `NULL` write).
143
- *
144
- * @internal
145
- */
146
131
  private _stringify_pii_for_write;
147
- /**
148
- * Read-side pii decoder: parses the TEXT column, and when
149
- * `pii_encryption` is configured, transparently decrypts any value
150
- * that came back as a JSON string. Plaintext writes deserialize to
151
- * objects and pass through — which is what makes mixed-data
152
- * rollouts (some pre-encryption rows, some post-) read cleanly.
153
- *
154
- * @internal
155
- */
156
132
  private _parse_pii_from_read;
157
133
  seed(): Promise<void>;
158
134
  drop(): Promise<void>;
159
- /** One write transaction: any failure rolls back and throws a {@link StoreError} naming the operation. */
160
135
  private _tx;
161
136
  dispose(): Promise<void>;
162
137
  commit<E extends Schemas>(stream: string, msgs: Message<E, keyof E>[], meta: EventMeta, expectedVersion?: number): Promise<Committed<E, keyof E>[]>;
@@ -170,23 +145,7 @@ export declare class SqliteStore implements Store {
170
145
  ack(leases: Lease[]): Promise<Lease[]>;
171
146
  block(leases: BlockedLease[]): Promise<BlockedLease[]>;
172
147
  defer(input: string[] | StreamFilter, deferred_at: number): Promise<number>;
173
- /**
174
- * Runs `UPDATE streams <set>` on the streams named by `input`, in one
175
- * write transaction that rolls back on failure. An explicit list is
176
- * de-duplicated, so a repeated name counts once (matching PG's set-based
177
- * `stream = ANY(...)`), and updated one name per statement, so a long list
178
- * never meets SQLite's bound-parameter limit. `set` and `where` bind
179
- * `params` in order; libSQL `?` placeholders are positional and can't be
180
- * reused, so a value used twice is passed twice.
181
- *
182
- * @returns Count of rows updated.
183
- */
184
148
  private _update;
185
- /**
186
- * Translate a {@link StreamFilter} to a SQLite `WHERE` clause fragment
187
- * plus positional args. Returns `"1"` (always true) when empty so
188
- * callers can compose it unconditionally.
189
- */
190
149
  private _filter_clause;
191
150
  reset(input: string[] | StreamFilter): Promise<number>;
192
151
  unblock(input: string[] | StreamFilter): Promise<number>;
@@ -216,16 +175,7 @@ export declare class SqliteStore implements Store {
216
175
  * since SQLite has no native array type.
217
176
  */
218
177
  query_stats<E extends Schemas>(input: string[] | Pick<StreamFilter, "stream" | "stream_exact">, options?: QueryStatsOptions<E>): Promise<Map<string, StreamStats<E>>>;
219
- /**
220
- * Cheap path — head (and optional tail) via ROW_NUMBER() over the
221
- * `(stream, version)` unique index. Parallel queries when tail set.
222
- */
223
178
  private _query_stats_heads_only;
224
- /**
225
- * Full-scan path — one CTE-based query with per-stream `COUNT(*)` and
226
- * `json_group_object(name, n)`. Heads (and optional tails) ride free
227
- * on the same scan.
228
- */
229
179
  private _query_stats_full_scan;
230
180
  prioritize(filter: StreamFilter, priority: number): Promise<number>;
231
181
  truncate(targets: Array<{
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite-store.d.ts","sourceRoot":"","sources":["../../src/sqlite-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,KAAK,EACL,OAAO,EACP,KAAK,EACL,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,KAAK,EACL,YAAY,EACZ,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EAEL,KAAK,UAAU,EAGhB,MAA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C,CAAC;QACnC,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,MAAM,CAAC,EAAE,IAAI,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;iBAKW,MAAM;mBACJ,SAAS,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;iBACnC,IAAI;QAiFlB;IAED;;;;;;;;;;OAUG;IACG,OAAO,CACX,MAAM,EAAE,CACN,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,KACpE,OAAO,CAAC,IAAI,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAmCf;IAED;;;;;;;;;;;;;;;;OAgBG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMhD;CACF"}
package/dist/index.cjs CHANGED
@@ -97,13 +97,11 @@ function streamPatternToGlob(input) {
97
97
  }
98
98
  var SqliteStore = class {
99
99
  client;
100
- /**
101
- * Memoized key resolver for the optional `pii_encryption` envelope.
102
- * Initialized in the constructor when encryption is configured;
103
- * `undefined` otherwise. The resolver caches the operator's key on
104
- * first use — rotation means restarting the store with a fresh
105
- * provider.
106
- */
100
+ // Memoized key resolver for the optional `pii_encryption` envelope.
101
+ // Initialized in the constructor when encryption is configured;
102
+ // `undefined` otherwise. The resolver caches the operator's key on
103
+ // first use — rotation means restarting the store with a fresh
104
+ // provider.
107
105
  _resolve_pii_key;
108
106
  constructor(config) {
109
107
  this.client = (0, import_client.createClient)({
@@ -112,14 +110,10 @@ var SqliteStore = class {
112
110
  });
113
111
  this._resolve_pii_key = config.pii_encryption ? (0, import_act_crypto.makeKeyResolver)(config.pii_encryption) : void 0;
114
112
  }
115
- /**
116
- * Write-side pii encoder: encrypts when `pii_encryption` is configured,
117
- * stringifies for the TEXT column either way. `null` passes through so
118
- * `forget_pii` semantics survive intact (the row format skips the
119
- * column entirely on a `NULL` write).
120
- *
121
- * @internal
122
- */
113
+ // Write-side pii encoder: encrypts when `pii_encryption` is configured,
114
+ // stringifies for the TEXT column either way. `null` passes through so
115
+ // `forget_pii` semantics survive intact (the row format skips the
116
+ // column entirely on a `NULL` write).
123
117
  async _stringify_pii_for_write(pii) {
124
118
  if (pii == null) return null;
125
119
  if (this._resolve_pii_key) {
@@ -127,15 +121,11 @@ var SqliteStore = class {
127
121
  }
128
122
  return JSON.stringify(pii);
129
123
  }
130
- /**
131
- * Read-side pii decoder: parses the TEXT column, and when
132
- * `pii_encryption` is configured, transparently decrypts any value
133
- * that came back as a JSON string. Plaintext writes deserialize to
134
- * objects and pass through — which is what makes mixed-data
135
- * rollouts (some pre-encryption rows, some post-) read cleanly.
136
- *
137
- * @internal
138
- */
124
+ // Read-side pii decoder: parses the TEXT column, and when
125
+ // `pii_encryption` is configured, transparently decrypts any value
126
+ // that came back as a JSON string. Plaintext writes deserialize to
127
+ // objects and pass through — which is what makes mixed-data
128
+ // rollouts (some pre-encryption rows, some post-) read cleanly.
139
129
  async _parse_pii_from_read(raw) {
140
130
  if (raw == null) return null;
141
131
  const parsed = parse_json(raw);
@@ -271,7 +261,7 @@ var SqliteStore = class {
271
261
  await this.client.execute("DROP TABLE IF EXISTS streams");
272
262
  await this.client.execute("DROP TABLE IF EXISTS correlated");
273
263
  }
274
- /** One write transaction: any failure rolls back and throws a {@link StoreError} naming the operation. */
264
+ // One write transaction: any failure rolls back and throws a {@link StoreError} naming the operation.
275
265
  async _tx(operation, work) {
276
266
  const tx = await this.client.transaction("write");
277
267
  try {
@@ -667,32 +657,25 @@ var SqliteStore = class {
667
657
  // Cleared by ack/block/reset/unblock. See {@link Store.defer}.
668
658
  async defer(input, deferred_at) {
669
659
  const at_iso = new Date(deferred_at).toISOString();
670
- try {
671
- return await this._update(input, "SET deferred_at = ?, retry = -1", [
672
- at_iso
673
- ]);
674
- } catch (e) {
675
- throw new import_act.StoreError("defer", { cause: e });
676
- }
660
+ return this._update("defer", input, "SET deferred_at = ?, retry = -1", [
661
+ at_iso
662
+ ]);
677
663
  }
678
- /**
679
- * Runs `UPDATE streams <set>` on the streams named by `input`, in one
680
- * write transaction that rolls back on failure. An explicit list is
681
- * de-duplicated, so a repeated name counts once (matching PG's set-based
682
- * `stream = ANY(...)`), and updated one name per statement, so a long list
683
- * never meets SQLite's bound-parameter limit. `set` and `where` bind
684
- * `params` in order; libSQL `?` placeholders are positional and can't be
685
- * reused, so a value used twice is passed twice.
686
- *
687
- * @returns Count of rows updated.
688
- */
689
- async _update(input, set, params = [], where) {
664
+ // Runs `UPDATE streams <set>` on the streams named by `input`, in one
665
+ // write transaction (`_tx`) that rolls back on failure. An explicit list is
666
+ // de-duplicated, so a repeated name counts once (matching PG's set-based
667
+ // `stream = ANY(...)`), and updated one name per statement, so a long list
668
+ // never meets SQLite's bound-parameter limit. `set` and `where` bind
669
+ // `params` in order; libSQL `?` placeholders are positional and can't be
670
+ // reused, so a value used twice is passed twice.
671
+ //
672
+ // @returns Count of rows updated.
673
+ _update(operation, input, set, params = [], where) {
690
674
  const selections = Array.isArray(input) ? [...new Set(input)].map((stream) => ({
691
675
  clause: "stream = ?",
692
676
  args: [stream]
693
677
  })) : [this._filter_clause(input)];
694
- const tx = await this.client.transaction("write");
695
- try {
678
+ return this._tx(operation, async (tx) => {
696
679
  let count = 0;
697
680
  for (const { clause, args } of selections) {
698
681
  const r = await tx.execute({
@@ -701,18 +684,12 @@ var SqliteStore = class {
701
684
  });
702
685
  count += r.rowsAffected;
703
686
  }
704
- await tx.commit();
705
687
  return count;
706
- } catch (e) {
707
- await tx.rollback();
708
- throw e;
709
- }
688
+ });
710
689
  }
711
- /**
712
- * Translate a {@link StreamFilter} to a SQLite `WHERE` clause fragment
713
- * plus positional args. Returns `"1"` (always true) when empty so
714
- * callers can compose it unconditionally.
715
- */
690
+ // Translate a {@link StreamFilter} to a SQLite `WHERE` clause fragment
691
+ // plus positional args. Returns `"1"` (always true) when empty so
692
+ // callers can compose it unconditionally.
716
693
  _filter_clause(filter) {
717
694
  const conditions = [];
718
695
  const args = [];
@@ -748,6 +725,7 @@ var SqliteStore = class {
748
725
  // --- reset: transactional, accepts names or filter ---
749
726
  reset(input) {
750
727
  return this._update(
728
+ "reset",
751
729
  input,
752
730
  `SET at = -1, retry = -1, blocked = 0, error = '',
753
731
  leased_by = NULL, leased_until = NULL, deferred_at = NULL`
@@ -760,6 +738,7 @@ var SqliteStore = class {
760
738
  // unblocked streams."
761
739
  unblock(input) {
762
740
  return this._update(
741
+ "unblock",
763
742
  Array.isArray(input) ? input : { ...input, blocked: void 0 },
764
743
  `SET retry = -1, blocked = 0, error = '',
765
744
  leased_by = NULL, leased_until = NULL, deferred_at = NULL`,
@@ -887,10 +866,8 @@ var SqliteStore = class {
887
866
  limit
888
867
  );
889
868
  }
890
- /**
891
- * Cheap path — head (and optional tail) via ROW_NUMBER() over the
892
- * `(stream, version)` unique index. Parallel queries when tail set.
893
- */
869
+ // Cheap path — head (and optional tail) via ROW_NUMBER() over the
870
+ // `(stream, version)` unique index. Parallel queries when tail set.
894
871
  async _query_stats_heads_only(from_clause, where_clause, args, want_tail, limit) {
895
872
  const cols = `e.id, e.stream, e.version, e.name, e.data, e.created, e.meta`;
896
873
  const limit_clause = limit !== void 0 ? " LIMIT ?" : "";
@@ -930,11 +907,9 @@ var SqliteStore = class {
930
907
  }
931
908
  return out;
932
909
  }
933
- /**
934
- * Full-scan path — one CTE-based query with per-stream `COUNT(*)` and
935
- * `json_group_object(name, n)`. Heads (and optional tails) ride free
936
- * on the same scan.
937
- */
910
+ // Full-scan path — one CTE-based query with per-stream `COUNT(*)` and
911
+ // `json_group_object(name, n)`. Heads (and optional tails) ride free
912
+ // on the same scan.
938
913
  async _query_stats_full_scan(from_clause, where_clause, args, want_tail, want_count, want_names, limit) {
939
914
  const tail_cte = want_tail ? `, tails AS (
940
915
  SELECT * FROM (
@@ -998,6 +973,7 @@ var SqliteStore = class {
998
973
  // --- prioritize: bulk priority update with filter ---
999
974
  prioritize(filter, priority) {
1000
975
  return this._update(
976
+ "prioritize",
1001
977
  filter,
1002
978
  "SET priority = ?",
1003
979
  [priority, priority],