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.cjs
CHANGED
|
@@ -5058,9 +5058,15 @@ var hydrateRows = (rows, plan) => {
|
|
|
5058
5058
|
}
|
|
5059
5059
|
return seen;
|
|
5060
5060
|
};
|
|
5061
|
+
const hasRelations = plan.relations.length > 0;
|
|
5061
5062
|
for (const row of rows) {
|
|
5062
5063
|
const rootId = row[plan.rootPrimaryKey];
|
|
5063
|
-
if (rootId === void 0)
|
|
5064
|
+
if (rootId === void 0 || rootId === null) {
|
|
5065
|
+
if (!hasRelations) {
|
|
5066
|
+
rootMap.set(Symbol(), createBaseRow(row, plan));
|
|
5067
|
+
}
|
|
5068
|
+
continue;
|
|
5069
|
+
}
|
|
5064
5070
|
const parent = getOrCreateParent(row);
|
|
5065
5071
|
if (!parent) continue;
|
|
5066
5072
|
for (const rel of plan.relations) {
|