@mikro-orm/knex 6.4.2-dev.0 → 6.4.2-dev.2

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.2-dev.0",
3
+ "version": "6.4.2-dev.2",
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.1"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.4.2-dev.0",
69
+ "@mikro-orm/core": "6.4.2-dev.2",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -75,4 +75,6 @@ export declare abstract class SchemaHelper {
75
75
  ignoreSchema?: string[];
76
76
  managementDbName?: string;
77
77
  };
78
+ private processComment;
79
+ protected handleMultilineComment(comment: string): string;
78
80
  }
@@ -147,7 +147,7 @@ class SchemaHelper {
147
147
  core_1.Utils.runIfNotEmpty(() => col.nullable(), column.nullable && guard('nullable'));
148
148
  core_1.Utils.runIfNotEmpty(() => col.notNullable(), !column.nullable && !column.generated);
149
149
  core_1.Utils.runIfNotEmpty(() => col.unsigned(), column.unsigned);
150
- core_1.Utils.runIfNotEmpty(() => col.comment(column.comment), column.comment);
150
+ core_1.Utils.runIfNotEmpty(() => col.comment(this.processComment(column.comment)), column.comment);
151
151
  this.configureColumnDefault(column, col, knex, changedProperties);
152
152
  return col;
153
153
  }
@@ -425,5 +425,11 @@ class SchemaHelper {
425
425
  get options() {
426
426
  return this.platform.getConfig().get('schemaGenerator');
427
427
  }
428
+ processComment(comment) {
429
+ return this.platform.getSchemaHelper().handleMultilineComment(comment);
430
+ }
431
+ handleMultilineComment(comment) {
432
+ return comment.replaceAll('\n', '\\n');
433
+ }
428
434
  }
429
435
  exports.SchemaHelper = SchemaHelper;