@mikro-orm/sql 7.1.9-dev.5 → 7.1.9-dev.7

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.9-dev.5",
3
+ "version": "7.1.9-dev.7",
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",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.1.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.1.9-dev.5"
56
+ "@mikro-orm/core": "7.1.9-dev.7"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
@@ -785,6 +785,10 @@ export class QueryBuilderHelper {
785
785
  appendGroupCondition(type, operator, subCondition) {
786
786
  const parts = [];
787
787
  const params = [];
788
+ // an empty disjunction is false, same as `$in: []`, while an empty conjunction is vacuously true
789
+ if (operator === '$or' && subCondition.length === 0) {
790
+ return { sql: '1 = 0', params };
791
+ }
788
792
  // single sub-condition can be ignored to reduce nesting of parens
789
793
  if (subCondition.length === 1 || operator === '$and') {
790
794
  for (const sub of subCondition) {