@mikro-orm/knex 6.5.8-dev.3 → 6.5.8-dev.5
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": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.5.8-dev.
|
|
3
|
+
"version": "6.5.8-dev.5",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@mikro-orm/core": "^6.5.7"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.5.8-dev.
|
|
69
|
+
"@mikro-orm/core": "6.5.8-dev.5",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|
package/query/QueryBuilder.js
CHANGED
|
@@ -1310,10 +1310,11 @@ class QueryBuilder {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
else if (join.parent?.type === enums_1.JoinType.nestedInnerJoin) {
|
|
1312
1312
|
const group = lookupParentGroup(join.parent);
|
|
1313
|
+
const nested = group ?? ((join.parent).nested ??= new Set());
|
|
1313
1314
|
join.type = join.type === enums_1.JoinType.innerJoin
|
|
1314
1315
|
? enums_1.JoinType.nestedInnerJoin
|
|
1315
1316
|
: enums_1.JoinType.nestedLeftJoin;
|
|
1316
|
-
|
|
1317
|
+
nested.add(join);
|
|
1317
1318
|
}
|
|
1318
1319
|
}
|
|
1319
1320
|
}
|
package/schema/DatabaseSchema.js
CHANGED
|
@@ -108,10 +108,15 @@ class DatabaseSchema {
|
|
|
108
108
|
table.addIndex(meta, { properties: meta.props.filter(prop => prop.primary).map(prop => prop.name) }, 'primary');
|
|
109
109
|
meta.checks.forEach(check => {
|
|
110
110
|
const columnName = check.property ? meta.properties[check.property].fieldNames[0] : undefined;
|
|
111
|
+
let expression = check.expression;
|
|
112
|
+
const raw = core_1.RawQueryFragment.getKnownFragment(expression);
|
|
113
|
+
if (raw) {
|
|
114
|
+
expression = platform.formatQuery(raw.sql, raw.params);
|
|
115
|
+
}
|
|
111
116
|
table.addCheck({
|
|
112
117
|
name: check.name,
|
|
113
|
-
expression
|
|
114
|
-
definition: `check ((${
|
|
118
|
+
expression,
|
|
119
|
+
definition: `check ((${expression}))`,
|
|
115
120
|
columnName,
|
|
116
121
|
});
|
|
117
122
|
});
|