@mikro-orm/sql 7.1.14-dev.8 → 7.1.14
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/sql",
|
|
3
|
-
"version": "7.1.14
|
|
3
|
+
"version": "7.1.14",
|
|
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
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"kysely": "0.29.5"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@mikro-orm/core": "^7.1.
|
|
53
|
+
"@mikro-orm/core": "^7.1.14"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.1.14
|
|
56
|
+
"@mikro-orm/core": "7.1.14"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|
|
@@ -533,6 +533,11 @@ export class QueryBuilderHelper {
|
|
|
533
533
|
const replacement = this.getOperatorReplacement(op, value);
|
|
534
534
|
const rawField = Raw.isKnownFragmentSymbol(key);
|
|
535
535
|
const fields = rawField ? [key] : Utils.splitPrimaryKeys(key);
|
|
536
|
+
// a raw key's arity is opaque, so the row-value form is detected from the payload instead
|
|
537
|
+
const rowValues = rawField &&
|
|
538
|
+
['$in', '$nin'].includes(op) &&
|
|
539
|
+
Array.isArray(value[op]) &&
|
|
540
|
+
value[op].every((v) => Array.isArray(v));
|
|
536
541
|
if (fields.length > 1 && Array.isArray(value[op])) {
|
|
537
542
|
const singleTuple = !value[op].every((v) => Array.isArray(v));
|
|
538
543
|
if (!this.#platform.allowsComparingTuples()) {
|
|
@@ -601,15 +606,15 @@ export class QueryBuilderHelper {
|
|
|
601
606
|
}
|
|
602
607
|
else {
|
|
603
608
|
const mappedKey = this.mapper(key, type, opValue, null);
|
|
604
|
-
const val = this.getValueReplacement(fields, opValue, params, op, prop);
|
|
609
|
+
const val = this.getValueReplacement(fields, opValue, params, op, prop, rowValues);
|
|
605
610
|
parts.push(`${this.#platform.quoteIdentifier(mappedKey)} ${replacement} ${val}`);
|
|
606
611
|
}
|
|
607
612
|
}
|
|
608
613
|
return { sql: parts.join(' and '), params };
|
|
609
614
|
}
|
|
610
|
-
getValueReplacement(fields, value, params, key, prop) {
|
|
615
|
+
getValueReplacement(fields, value, params, key, prop, rowValues = false) {
|
|
611
616
|
if (Array.isArray(value)) {
|
|
612
|
-
if (fields.length > 1) {
|
|
617
|
+
if (fields.length > 1 || rowValues) {
|
|
613
618
|
const tmp = [];
|
|
614
619
|
for (const field of value) {
|
|
615
620
|
tmp.push(`(${field.map(() => '?').join(', ')})`);
|