@mikro-orm/knex 6.4.9-dev.3 → 6.4.9-dev.4

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.4.9-dev.3",
3
+ "version": "6.4.9-dev.4",
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.4.8"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.4.9-dev.3",
69
+ "@mikro-orm/core": "6.4.9-dev.4",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -260,6 +260,10 @@ class QueryBuilderHelper {
260
260
  });
261
261
  return this.wrapQueryGroup(parts, key);
262
262
  }
263
+ const rawField = core_1.RawQueryFragment.getKnownFragment(key);
264
+ if (!rawField && !core_1.Utils.isOperator(key, false) && !this.isPrefixed(key)) {
265
+ key = `${alias}.${key}`;
266
+ }
263
267
  if (this.isSimpleRegExp(value)) {
264
268
  params.push(this.getRegExpParam(value));
265
269
  return `${this.knex.ref(this.mapper(key))} like ?`;
@@ -297,7 +301,6 @@ class QueryBuilderHelper {
297
301
  if (operator === '$exists') {
298
302
  value = null;
299
303
  }
300
- const rawField = core_1.RawQueryFragment.getKnownFragment(key);
301
304
  if (rawField) {
302
305
  let sql = rawField.sql.replaceAll(core_1.ALIAS_REPLACEMENT, alias);
303
306
  params.push(...rawField.params);