@crvouga/mockingbird-service-postgres 3.12.1 → 3.12.3

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.js CHANGED
@@ -222,7 +222,13 @@ var IndexedDBDurabilityBackend = class {
222
222
  this.durability = options.durability ?? "strict";
223
223
  }
224
224
  open() {
225
- this.database ??= new Promise((resolve, reject) => {
225
+ if (this.database)
226
+ return this.database;
227
+ const opening = new Promise((resolve, reject) => {
228
+ const forget = () => {
229
+ if (this.database === opening)
230
+ this.database = void 0;
231
+ };
226
232
  const request = this.factory.open(this.name, 1);
227
233
  request.onupgradeneeded = () => {
228
234
  const db = request.result;
@@ -231,7 +237,7 @@ var IndexedDBDurabilityBackend = class {
231
237
  pages.createIndex("image", "key");
232
238
  };
233
239
  request.onerror = () => {
234
- this.database = void 0;
240
+ forget();
235
241
  reject(request.error);
236
242
  };
237
243
  request.onblocked = () => {
@@ -240,12 +246,14 @@ var IndexedDBDurabilityBackend = class {
240
246
  const db = request.result;
241
247
  db.onversionchange = () => {
242
248
  db.close();
243
- this.database = void 0;
249
+ forget();
244
250
  };
251
+ db.onclose = forget;
245
252
  resolve(db);
246
253
  };
247
254
  });
248
- return this.database;
255
+ this.database = opening;
256
+ return opening;
249
257
  }
250
258
  async load(key2) {
251
259
  const db = await this.open();
@@ -32493,7 +32501,7 @@ function analyzeSchema(sql, options = {}) {
32493
32501
  const diagnosticLimit = bounded(options.maxDiagnostics, 100, 1e3);
32494
32502
  const report = {
32495
32503
  engine: "mockingbird-postgres",
32496
- version: true ? "3.12.1" : "source-tree",
32504
+ version: true ? "3.12.3" : "source-tree",
32497
32505
  statements: 0,
32498
32506
  accepted: 0,
32499
32507
  compatible: null,