@dudousxd/nestjs-durable-store-drizzle 0.28.0 → 0.29.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/dist/index.cjs CHANGED
@@ -382,8 +382,11 @@ var DrizzleStateStore = class {
382
382
  __name(this, "DrizzleStateStore");
383
383
  }
384
384
  db;
385
- constructor(db) {
385
+ constructor(db, options = {}) {
386
386
  this.db = db;
387
+ if (options.schema !== void 0) {
388
+ throw new Error(`[nestjs-durable] store-drizzle: the schema option (${JSON.stringify(options.schema)}) is not supported on SQLite, which has no schemas. Remove it, or use DrizzlePgStateStore from '@dudousxd/nestjs-durable-store-drizzle/pg'.`);
389
+ }
387
390
  }
388
391
  async tryAdmitSingleton(runId, tag, workflow, limit, retryWakeAt) {
389
392
  return this.db.transaction((tx) => {
@@ -644,7 +647,9 @@ var DrizzleStateStore = class {
644
647
  error: s.error ?? null,
645
648
  events: s.events ?? null,
646
649
  startedAt: s.startedAt.getTime(),
647
- finishedAt: s.finishedAt.getTime()
650
+ finishedAt: s.finishedAt.getTime(),
651
+ // A settled step has no dispatch lease left.
652
+ wakeAt: null
648
653
  });
649
654
  }
650
655
  const writes = [];
@@ -1366,7 +1371,8 @@ var SETTLED_FIELDS = [
1366
1371
  "error",
1367
1372
  "events",
1368
1373
  "startedAt",
1369
- "finishedAt"
1374
+ "finishedAt",
1375
+ "wakeAt"
1370
1376
  ];
1371
1377
  function inSequence(steps, from = 0) {
1372
1378
  for (let i = from; i < steps.length; i += 1) {