@mikro-orm/knex 6.2.7-dev.3 → 6.2.7-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.2.7-dev.3",
3
+ "version": "6.2.7-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,6 +66,6 @@
66
66
  "@mikro-orm/core": "^6.2.6"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.2.7-dev.3"
69
+ "@mikro-orm/core": "6.2.7-dev.5"
70
70
  }
71
71
  }
@@ -159,6 +159,7 @@ class ObjectCriteriaNode extends CriteriaNode_1.CriteriaNode {
159
159
  o[key] = value;
160
160
  return;
161
161
  }
162
+ /* istanbul ignore next */
162
163
  if (key === '$and') {
163
164
  o.$and.push({ [key]: value });
164
165
  return;
@@ -497,7 +497,7 @@ class QueryBuilderHelper {
497
497
  let [alias, field] = this.splitField(f, true);
498
498
  alias = populate[alias] || alias;
499
499
  const prop = this.getProperty(field, alias);
500
- const noPrefix = (prop && prop.persist === false && !prop.formula) || core_1.RawQueryFragment.isKnownFragment(f);
500
+ const noPrefix = (prop && prop.persist === false && !prop.formula && !prop.embedded) || core_1.RawQueryFragment.isKnownFragment(f);
501
501
  const column = this.mapper(noPrefix ? field : `${alias}.${field}`, type, undefined, null);
502
502
  /* istanbul ignore next */
503
503
  const rawColumn = core_1.Utils.isString(column) ? column.split('.').map(e => this.knex.ref(e)).join('.') : column;
@@ -441,6 +441,7 @@ class SqlSchemaGenerator extends core_1.AbstractSchemaGenerator {
441
441
  this.config.set('dbName', this.helper.getManagementDbName());
442
442
  await this.driver.reconnect();
443
443
  await this.execute(this.helper.getDropDatabaseSQL(name));
444
+ this.config.set('dbName', name);
444
445
  }
445
446
  async execute(sql, options = {}) {
446
447
  options.wrap ??= false;