@mikro-orm/mssql 6.2.10-dev.73 → 6.2.10-dev.75

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.
@@ -341,14 +341,14 @@ class MsSqlSchemaHelper extends knex_1.SchemaHelper {
341
341
  return super.createTableColumn(table, column, fromTable, changedProperties);
342
342
  }
343
343
  inferLengthFromColumnType(type) {
344
- const match = type.match(/n?varchar\((-?\d+|max)\)/);
344
+ const match = type.match(/^(\w+)\s*\(\s*(-?\d+|max)\s*\)/);
345
345
  if (!match) {
346
- return undefined;
346
+ return;
347
347
  }
348
- if (match[1] === 'max') {
348
+ if (match[2] === 'max' && ['varchar', 'nvarchar'].includes(match[1])) {
349
349
  return -1;
350
350
  }
351
- return +match[1];
351
+ return +match[2];
352
352
  }
353
353
  wrap(val, type) {
354
354
  const stringType = type instanceof knex_1.StringType || type instanceof knex_1.TextType || type instanceof knex_1.EnumType || type instanceof UnicodeStringType_1.UnicodeStringType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mssql",
3
- "version": "6.2.10-dev.73",
3
+ "version": "6.2.10-dev.75",
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,7 +58,7 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "@mikro-orm/knex": "6.2.10-dev.73",
61
+ "@mikro-orm/knex": "6.2.10-dev.75",
62
62
  "tedious": "18.2.1",
63
63
  "tsqlstring": "1.0.1"
64
64
  },
@@ -66,6 +66,6 @@
66
66
  "@mikro-orm/core": "^6.2.9"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.2.10-dev.73"
69
+ "@mikro-orm/core": "6.2.10-dev.75"
70
70
  }
71
71
  }