metal-orm 1.0.96 → 1.0.97
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 +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/orm/hydration.ts +9 -1
package/dist/index.js
CHANGED
|
@@ -4699,9 +4699,15 @@ var hydrateRows = (rows, plan) => {
|
|
|
4699
4699
|
}
|
|
4700
4700
|
return seen;
|
|
4701
4701
|
};
|
|
4702
|
+
const hasRelations = plan.relations.length > 0;
|
|
4702
4703
|
for (const row of rows) {
|
|
4703
4704
|
const rootId = row[plan.rootPrimaryKey];
|
|
4704
|
-
if (rootId === void 0)
|
|
4705
|
+
if (rootId === void 0 || rootId === null) {
|
|
4706
|
+
if (!hasRelations) {
|
|
4707
|
+
rootMap.set(Symbol(), createBaseRow(row, plan));
|
|
4708
|
+
}
|
|
4709
|
+
continue;
|
|
4710
|
+
}
|
|
4705
4711
|
const parent = getOrCreateParent(row);
|
|
4706
4712
|
if (!parent) continue;
|
|
4707
4713
|
for (const rel of plan.relations) {
|