@crvouga/mockingbird-service-sqs 3.9.0 → 3.10.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog — @crvouga/mockingbird-service-sqs
2
2
 
3
+ ## 3.10.1 (2026-11-02)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - reopen IndexedDB durability connection after the browser force-closes it ([d0b45aa](https://github.com/crvouga/mockingbird/commit/d0b45aa1d12a55967e72b8ddc6573f5998c377ce))
8
+ - schedule packages whose tasks read another package's files ([7df459d](https://github.com/crvouga/mockingbird/commit/7df459d96132b4f84fa3553b1f907871c7e4f739))
9
+
10
+ ### Dependencies
11
+
12
+ - `@crvouga/mockingbird-service-sqlite`
13
+
14
+ ## 3.10.0 (2026-10-24)
15
+
16
+ ### Features
17
+
18
+ - add buffered SQL durability ([288bdcc](https://github.com/crvouga/mockingbird/commit/288bdcca84582787a54c4fdf9e803db9aac0b8d7))
19
+ - add efficient browser durability ([a8be579](https://github.com/crvouga/mockingbird/commit/a8be5799a883ddf6f731208e06f399410de4661a))
20
+
3
21
  ## 3.9.0 (2026-10-21)
4
22
 
5
23
  ### Features
@@ -9,7 +9,7 @@ import {
9
9
  parseFaultHeader,
10
10
  resolveAdminPrefix,
11
11
  restoreClock
12
- } from "./chunk-GWRTPEQW.js";
12
+ } from "./chunk-JILVZQ7B.js";
13
13
 
14
14
  // ../../adapters/node/dist/cli.js
15
15
  import { readFile as readFile5 } from "node:fs/promises";
@@ -3057,7 +3057,7 @@ async function preflightFleet(config, options) {
3057
3057
  break;
3058
3058
  }
3059
3059
  }
3060
- targets.set(name, { ...target, packageVersion: packageVersion ?? "3.9.0" });
3060
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "3.10.1" });
3061
3061
  } catch (error) {
3062
3062
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3063
3063
  }
@@ -5012,4 +5012,4 @@ export {
5012
5012
  createServer2 as createServer,
5013
5013
  serveTarget
5014
5014
  };
5015
- //# sourceMappingURL=chunk-GMJLAKCG.js.map
5015
+ //# sourceMappingURL=chunk-CHTYVYE2.js.map
@@ -381,15 +381,24 @@ var Collection = class {
381
381
  sqlite;
382
382
  namespace;
383
383
  collectionName;
384
+ statements = /* @__PURE__ */ new Map();
385
+ prepare(sql) {
386
+ let statement = this.statements.get(sql);
387
+ if (!statement) {
388
+ statement = this.sqlite.prepare(sql);
389
+ this.statements.set(sql, statement);
390
+ }
391
+ return statement;
392
+ }
384
393
  constructor(sqlite, namespace, collectionName) {
385
394
  this.sqlite = sqlite;
386
395
  this.namespace = namespace;
387
396
  this.collectionName = collectionName;
388
397
  }
389
398
  bumpCollectionSeq() {
390
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
399
+ const row = this.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
391
400
  const next = (row?.value ?? 0) + 1;
392
- this.sqlite.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
401
+ this.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
393
402
  ON CONFLICT(namespace, name, kind) DO UPDATE SET value = excluded.value`).run(this.namespace, this.collectionName, next);
394
403
  return next;
395
404
  }
@@ -397,13 +406,13 @@ var Collection = class {
397
406
  return this.sqlite.transaction(() => this.bumpCollectionSeq());
398
407
  }
399
408
  get(id) {
400
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
409
+ const row = this.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
401
410
  if (!row)
402
411
  return void 0;
403
412
  return JSON.parse(row.value).value;
404
413
  }
405
414
  has(id) {
406
- const row = this.sqlite.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
415
+ const row = this.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
407
416
  return row !== void 0;
408
417
  }
409
418
  /** Insert a new record, assigning it the next sequence number. */
@@ -411,7 +420,7 @@ var Collection = class {
411
420
  return this.sqlite.transaction(() => {
412
421
  const seq = this.bumpCollectionSeq();
413
422
  const stored = { seq, value };
414
- this.sqlite.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
423
+ this.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
415
424
  VALUES (?, ?, ?, ?, ?)
416
425
  ON CONFLICT(namespace, collection, id) DO UPDATE SET seq = excluded.seq, value = excluded.value`).run(this.namespace, this.collectionName, id, seq, JSON.stringify(stored));
417
426
  return stored;
@@ -420,25 +429,25 @@ var Collection = class {
420
429
  /** Replace an existing record's value, keeping its position. */
421
430
  update(id, value) {
422
431
  return this.sqlite.transaction(() => {
423
- const row = this.sqlite.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
432
+ const row = this.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
424
433
  if (!row)
425
434
  return void 0;
426
435
  const stored = { seq: row.seq, value };
427
- this.sqlite.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
436
+ this.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
428
437
  return stored;
429
438
  });
430
439
  }
431
440
  delete(id) {
432
- const result = this.sqlite.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
441
+ const result = this.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
433
442
  return result.changes > 0;
434
443
  }
435
444
  /** How many records the collection holds, without reading them. */
436
445
  count() {
437
- const row = this.sqlite.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
446
+ const row = this.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
438
447
  return Number(row?.n ?? 0);
439
448
  }
440
449
  list(options = {}) {
441
- const rows = this.sqlite.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
450
+ const rows = this.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
442
451
  const out = [];
443
452
  for (const row of rows) {
444
453
  const stored = JSON.parse(row.value);
@@ -3902,7 +3911,7 @@ var stateAdminRoutes = (routes) => {
3902
3911
  };
3903
3912
 
3904
3913
  // ../core/dist/version.js
3905
- var PACKAGE_VERSION = true ? "3.9.0" : UNRELEASED_VERSION;
3914
+ var PACKAGE_VERSION = true ? "3.10.1" : UNRELEASED_VERSION;
3906
3915
 
3907
3916
  // ../core/dist/webhooks.js
3908
3917
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -5988,4 +5997,4 @@ export {
5988
5997
  accessKeyCredential,
5989
5998
  SqsAPI
5990
5999
  };
5991
- //# sourceMappingURL=chunk-GWRTPEQW.js.map
6000
+ //# sourceMappingURL=chunk-JILVZQ7B.js.map