@carbonorm/carbonnode 3.9.6 → 3.10.0
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.js +10 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/sakila-db/C6.js +1 -1
- package/src/__tests__/sakila-db/C6.ts +1 -1
- package/src/__tests__/sqlBuilders.expressions.test.ts +30 -1
- package/src/api/orm/builders/ConditionBuilder.ts +11 -1
|
@@ -545,8 +545,18 @@ export abstract class ConditionBuilder<
|
|
|
545
545
|
if (Array.isArray(node)) {
|
|
546
546
|
if (node.length === 0) return '';
|
|
547
547
|
|
|
548
|
+
// Support both [left, operator, right] and [operator, left, right]
|
|
548
549
|
if (node.length === 3 && typeof node[0] === 'string' && typeof node[1] === 'string') {
|
|
549
|
-
|
|
550
|
+
const opAsSecond = this.isOperator(node[1]);
|
|
551
|
+
const opAsFirst = this.isOperator(node[0]);
|
|
552
|
+
|
|
553
|
+
if (opAsSecond) {
|
|
554
|
+
return this.buildOperatorExpression(node[1], [node[0], node[2]], params, node[0]);
|
|
555
|
+
}
|
|
556
|
+
if (opAsFirst) {
|
|
557
|
+
return this.buildOperatorExpression(node[0], [node[1], node[2]], params, node[1]);
|
|
558
|
+
}
|
|
559
|
+
// fall-through to treat as grouped expressions
|
|
550
560
|
}
|
|
551
561
|
|
|
552
562
|
const parts = node
|