@rulvar/store-sqlite 1.3.0 → 1.3.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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -66,7 +66,7 @@ var SqliteStore = class {
66
66
  /** Rejects unless `lease` is the CURRENT live lease for its run. */
67
67
  assertFencing(lease) {
68
68
  const live = this.liveLease(lease.runId);
69
- if (live === void 0 || live.owner !== lease.owner || live.epoch !== lease.epoch) throw new LeaseHeldError(`stale fencing epoch for run '${lease.runId}': lease (owner ${lease.owner}, epoch ${lease.epoch}) is not the current holder; the append or renew is rejected and nothing became visible (docs/03, section 12.3)`);
69
+ if (live === void 0 || live.owner !== lease.owner || live.epoch !== lease.epoch) throw new LeaseHeldError(`stale fencing epoch for run '${lease.runId}': lease (owner ${lease.owner}, epoch ${lease.epoch}) is not the current holder; the append or renew is rejected and nothing became visible`);
70
70
  }
71
71
  async append(runId, e, lease) {
72
72
  if (lease !== void 0) this.assertFencing(lease);
@@ -103,7 +103,7 @@ var SqliteStore = class {
103
103
  this.db.exec("BEGIN IMMEDIATE");
104
104
  try {
105
105
  const live = this.liveLease(runId);
106
- if (live !== void 0) throw new LeaseHeldError(`run '${runId}' is leased by '${live.owner}' (epoch ${live.epoch}); acquire on a held lease rejects (docs/03, section 12.3)`);
106
+ if (live !== void 0) throw new LeaseHeldError(`run '${runId}' is leased by '${live.owner}' (epoch ${live.epoch}); acquire on a held lease rejects`);
107
107
  const epoch = (this.db.prepare("SELECT epoch FROM epochs WHERE run_id = ?").get(runId)?.epoch ?? 0) + 1;
108
108
  this.db.prepare("INSERT INTO epochs (run_id, epoch) VALUES (?, ?) ON CONFLICT(run_id) DO UPDATE SET epoch = excluded.epoch").run(runId, epoch);
109
109
  this.db.prepare("INSERT INTO leases (run_id, owner, epoch, expires_at) VALUES (?, ?, ?, ?) ON CONFLICT(run_id) DO UPDATE SET owner = excluded.owner, epoch = excluded.epoch, expires_at = excluded.expires_at").run(runId, owner, epoch, this.now() + this.ttlMs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/store-sqlite",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "rulvar SQLite store implementing JournalStore and LeasableStore with a fencing epoch.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -22,13 +22,13 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "@rulvar/core": "1.3.0"
25
+ "@rulvar/core": "1.3.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.20.0",
29
29
  "tsdown": "^0.22.3",
30
30
  "typescript": "~6.0.3",
31
- "@rulvar/store-conformance": "1.3.0"
31
+ "@rulvar/store-conformance": "1.3.1"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",