@event-driven-io/emmett-sqlite 0.38.2 → 0.38.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.
package/dist/index.cjs CHANGED
@@ -99,7 +99,7 @@ var rollbackTransaction = (db) => new Promise((resolve, reject) => {
99
99
  });
100
100
  });
101
101
 
102
- // ../emmett/dist/chunk-SJ7ERGWB.js
102
+ // ../emmett/dist/chunk-O2VMBOV4.js
103
103
  var isNumber = (val) => typeof val === "number" && val === val;
104
104
  var isBigint = (val) => typeof val === "bigint" && val === val;
105
105
  var isString = (val) => typeof val === "string";
@@ -112,6 +112,15 @@ var EmmettError = class _EmmettError extends Error {
112
112
  this.errorCode = errorCode;
113
113
  Object.setPrototypeOf(this, _EmmettError.prototype);
114
114
  }
115
+ static mapFrom(error) {
116
+ if (error instanceof _EmmettError) {
117
+ return error;
118
+ }
119
+ return new _EmmettError({
120
+ errorCode: "errorCode" in error && error.errorCode !== void 0 && error.errorCode !== null ? error.errorCode : 500,
121
+ message: _nullishCoalesce(error.message, () => ( "An unknown error occurred"))
122
+ });
123
+ }
115
124
  };
116
125
  var ConcurrencyError = class _ConcurrencyError extends EmmettError {
117
126
  constructor(current, expected, message) {
@@ -203,6 +212,7 @@ var asyncRetry = async (fn, opts) => {
203
212
  } catch (error2) {
204
213
  if (_optionalChain([opts, 'optionalAccess', _15 => _15.shouldRetryError]) && !opts.shouldRetryError(error2)) {
205
214
  bail(error2);
215
+ return void 0;
206
216
  }
207
217
  throw error2;
208
218
  }
@@ -641,7 +651,7 @@ var streamsTableSQL = sql(
641
651
  stream_type TEXT NOT NULL,
642
652
  stream_metadata JSONB NOT NULL,
643
653
  is_archived BOOLEAN NOT NULL DEFAULT FALSE,
644
- PRIMARY KEY (stream_id, stream_position, partition, is_archived),
654
+ PRIMARY KEY (stream_id, partition, is_archived),
645
655
  UNIQUE (stream_id, partition, is_archived)
646
656
  );`
647
657
  );