@mikro-orm/knex 6.0.0-dev.49 → 6.0.0-dev.50

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.
@@ -273,7 +273,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
273
273
  }
274
274
  const addParams = (prop, row) => {
275
275
  if (options.convertCustomTypes && prop.customType) {
276
- params.push(prop.customType.convertToDatabaseValue(row[prop.name], this.platform, { key: prop.name, mode: 'query' }));
276
+ params.push(prop.customType.convertToDatabaseValue(row[prop.name], this.platform, { key: prop.name, mode: 'query-data' }));
277
277
  return;
278
278
  }
279
279
  params.push(row[prop.name]);
package/index.mjs CHANGED
@@ -189,6 +189,7 @@ export const equals = mod.equals;
189
189
  export const expr = mod.expr;
190
190
  export const helper = mod.helper;
191
191
  export const knex = mod.knex;
192
+ export const parseJsonSafe = mod.parseJsonSafe;
192
193
  export const raw = mod.raw;
193
194
  export const ref = mod.ref;
194
195
  export const rel = mod.rel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.0.0-dev.49",
3
+ "version": "6.0.0-dev.50",
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",
@@ -58,14 +58,14 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "fs-extra": "11.1.0",
61
+ "fs-extra": "11.1.1",
62
62
  "knex": "2.4.2",
63
63
  "sqlstring": "2.3.3"
64
64
  },
65
65
  "devDependencies": {
66
- "@mikro-orm/core": "^5.6.15"
66
+ "@mikro-orm/core": "^5.6.16"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "~6.0.0-dev.49"
69
+ "@mikro-orm/core": "~6.0.0-dev.50"
70
70
  }
71
71
  }
@@ -630,7 +630,7 @@ class QueryBuilderHelper {
630
630
  return;
631
631
  }
632
632
  if (prop.customType && convertCustomTypes && !this.platform.isRaw(data[k])) {
633
- data[k] = prop.customType.convertToDatabaseValue(data[k], this.platform, { fromQuery: true, key: k, mode: 'query' });
633
+ data[k] = prop.customType.convertToDatabaseValue(data[k], this.platform, { fromQuery: true, key: k, mode: 'query-data' });
634
634
  }
635
635
  if (prop.customType && 'convertToDatabaseValueSQL' in prop.customType && !this.platform.isRaw(data[k])) {
636
636
  const quoted = this.platform.quoteValue(data[k]);
@@ -132,7 +132,9 @@ class SqlSchemaGenerator extends core_1.AbstractSchemaGenerator {
132
132
  return this.diffToSQL(diffUp, options);
133
133
  }
134
134
  async getUpdateSchemaMigrationSQL(options = {}) {
135
- await this.ensureDatabase();
135
+ if (!options.fromSchema) {
136
+ await this.ensureDatabase();
137
+ }
136
138
  const { fromSchema, toSchema } = await this.prepareSchemaForComparison(options);
137
139
  const comparator = new SchemaComparator_1.SchemaComparator(this.platform);
138
140
  const diffUp = comparator.compare(fromSchema, toSchema);