@guren/orm 1.0.0-rc.16 → 1.0.0-rc.17
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 +17 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
// src/instance-guard.ts
|
|
2
|
+
var INSTANCE_KEY = /* @__PURE__ */ Symbol.for("guren.orm.loaded");
|
|
3
|
+
var globalScope = globalThis;
|
|
4
|
+
var marker = globalScope[INSTANCE_KEY];
|
|
5
|
+
if (!marker) {
|
|
6
|
+
globalScope[INSTANCE_KEY] = { count: 1, warned: false };
|
|
7
|
+
} else {
|
|
8
|
+
marker.count += 1;
|
|
9
|
+
if (!marker.warned) {
|
|
10
|
+
marker.warned = true;
|
|
11
|
+
console.warn(
|
|
12
|
+
`[guren/orm] ${marker.count} copies of @guren/orm are loaded in this process. Adapter configuration and model state are NOT shared between copies, so database access will fail with "database has not been configured" for models imported through the extra copy.
|
|
13
|
+
[guren/orm] This usually means mixed @guren/* versions (check \`bun pm ls | grep @guren\`). Fix it by aligning all @guren/* packages to the same release, e.g. \`bunx guren upgrade\` or updating every @guren/* entry in package.json together, then reinstalling.`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
1
18
|
// src/adapters/drizzle-adapter.ts
|
|
2
19
|
import { and as and2, asc, count, desc, eq as eq2, inArray as inArray2, isNull as isNull2 } from "drizzle-orm";
|
|
3
20
|
|