@ultimat3/db 19.4.0 → 20.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/db",
3
- "version": "19.4.0",
3
+ "version": "20.1.0",
4
4
  "description": "Postgres access, transactions, migrations and drift detection",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "test": "bun test"
32
32
  },
33
33
  "dependencies": {
34
- "@ultimat3/core": "19.4.0"
34
+ "@ultimat3/core": "20.1.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@electric-sql/pglite": ">=0.5.0"
package/src/index.ts CHANGED
@@ -160,6 +160,8 @@ export {
160
160
  loadPgliteDriver,
161
161
  PGLITE_FIX,
162
162
  PGLITE_MEMORY,
163
+ PGLITE_MISSING,
164
+ PGLITE_PACKAGE,
163
165
  pgliteDataDir,
164
166
  } from './pglite';
165
167
  export type { PgliteBranchInfo, PgliteBranchOptions } from './pglite-branch';
package/src/pglite.ts CHANGED
@@ -53,7 +53,20 @@ export const PGLITE_MEMORY = 'memory://';
53
53
 
54
54
  const PGLITE_URL = 'pglite://';
55
55
 
56
- const PGLITE_PACKAGE = '@electric-sql/pglite';
56
+ /**
57
+ * The optional peer's specifier. Exported because `x doctor` asks whether it RESOLVES — a resolve,
58
+ * never an import, since loading it boots the WASM build and takes the single-writer lock — and a
59
+ * diagnostic that spelled the package name a second time is a diagnostic that can name the wrong
60
+ * one after a rename.
61
+ */
62
+ export const PGLITE_PACKAGE = '@electric-sql/pglite';
63
+
64
+ /**
65
+ * Why there is no embedded database when that specifier does not resolve. One sentence, shared:
66
+ * `x doctor` reports this condition BEFORE any query reaches this module, and two wordings for one
67
+ * cause are two answers to "what do I do".
68
+ */
69
+ export const PGLITE_MISSING = `${PGLITE_PACKAGE} is not installed, so there is no embedded database`;
57
70
 
58
71
  /**
59
72
  * The specifier is held in a variable on purpose: a literal would make every consumer's `tsc`
@@ -90,7 +103,7 @@ export async function loadPgliteDriver(options: PgliteOptions = {}): Promise<Pgl
90
103
  try {
91
104
  loaded = await (options.load ?? importPglite)();
92
105
  } catch (error) {
93
- throw missing(`${PGLITE_PACKAGE} is not installed, so there is no embedded database`, error);
106
+ throw missing(PGLITE_MISSING, error);
94
107
  }
95
108
  const PGlite = pgliteConstructor(loaded);
96
109
  try {