@mikro-orm/mssql 7.0.0-dev.32 → 7.0.0-dev.320

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.
@@ -1,9 +1,9 @@
1
- import { EnumType, SchemaHelper, StringType, TextType, Utils, } from '@mikro-orm/knex';
1
+ import { EnumType, SchemaHelper, StringType, TextType, Utils, } from '@mikro-orm/sql';
2
2
  import { UnicodeStringType } from './UnicodeStringType.js';
3
3
  export class MsSqlSchemaHelper extends SchemaHelper {
4
4
  static DEFAULT_VALUES = {
5
- 'true': ['1'],
6
- 'false': ['0'],
5
+ true: ['1'],
6
+ false: ['0'],
7
7
  'getdate()': ['current_timestamp'],
8
8
  };
9
9
  getManagementDbName() {
@@ -25,21 +25,39 @@ export class MsSqlSchemaHelper extends SchemaHelper {
25
25
  left join sys.extended_properties ep on ep.major_id = t.id and ep.name = 'MS_Description' and ep.minor_id = 0
26
26
  order by schema_name(t2.schema_id), t.name`;
27
27
  }
28
+ getListViewsSQL() {
29
+ return `select v.name as view_name, schema_name(v.schema_id) as schema_name, m.definition as view_definition
30
+ from sys.views v
31
+ inner join sys.sql_modules m on v.object_id = m.object_id
32
+ order by schema_name(v.schema_id), v.name`;
33
+ }
34
+ async loadViews(schema, connection) {
35
+ const views = await connection.execute(this.getListViewsSQL());
36
+ for (const view of views) {
37
+ // Extract SELECT statement from CREATE VIEW ... AS SELECT ...
38
+ const match = /\bAS\s+(.+)$/is.exec(view.view_definition);
39
+ const definition = match?.[1]?.trim();
40
+ if (definition) {
41
+ const schemaName = view.schema_name === this.platform.getDefaultSchemaName() ? undefined : view.schema_name;
42
+ schema.addView(view.view_name, schemaName, definition);
43
+ }
44
+ }
45
+ }
28
46
  async getNamespaces(connection) {
29
47
  const sql = `select name as schema_name from sys.schemas order by name`;
30
48
  const res = await connection.execute(sql);
31
49
  return res.map(row => row.schema_name);
32
50
  }
33
51
  normalizeDefaultValue(defaultValue, length, defaultValues = {}, stripQuotes = false) {
34
- let match = defaultValue?.match(/^\((.*)\)$/);
52
+ let match = /^\((.*)\)$/.exec(defaultValue);
35
53
  if (match) {
36
54
  defaultValue = match[1];
37
55
  }
38
- match = defaultValue?.match(/^\((.*)\)$/);
56
+ match = /^\((.*)\)$/.exec(defaultValue);
39
57
  if (match) {
40
58
  defaultValue = match[1];
41
59
  }
42
- match = defaultValue?.match(/^'(.*)'$/);
60
+ match = /^'(.*)'$/.exec(defaultValue);
43
61
  if (stripQuotes && match) {
44
62
  defaultValue = match[1];
45
63
  }
@@ -66,10 +84,10 @@ export class MsSqlSchemaHelper extends SchemaHelper {
66
84
  left join sys.computed_columns cmp on cmp.name = ic.column_name and cmp.object_id = object_id(ic.table_schema + '.' + ic.table_name)
67
85
  left join sys.extended_properties t4 on t4.major_id = object_id(ic.table_schema + '.' + ic.table_name) and t4.name = 'MS_Description' and t4.minor_id = sc.column_id
68
86
  left join sys.default_constraints t5 on sc.default_object_id = t5.object_id
69
- where (${[...tablesBySchemas.entries()].map(([schema, tables]) => `(ic.table_name in (${tables.map(t => this.platform.quoteValue(t.table_name)).join(',')}) and ic.table_schema = '${schema}')`).join(' OR ')})
87
+ where (${[...tablesBySchemas.entries()].map(([schema, tables]) => `(ic.table_name in (${tables.map(t => this.platform.quoteValue(t.table_name)).join(',')}) and ic.table_schema = '${schema}')`).join(' or ')})
70
88
  order by ordinal_position`;
71
89
  const allColumns = await connection.execute(sql);
72
- const str = (val) => val != null ? '' + val : val;
90
+ const str = (val) => (val != null ? '' + val : val);
73
91
  const ret = {};
74
92
  for (const col of allColumns) {
75
93
  const mappedType = this.platform.getMappedType(col.data_type);
@@ -77,7 +95,9 @@ export class MsSqlSchemaHelper extends SchemaHelper {
77
95
  const increments = col.is_identity === 1 && connection.getPlatform().isNumericColumn(mappedType);
78
96
  const key = this.getTableKey(col);
79
97
  /* v8 ignore next */
80
- const generated = col.generation_expression ? `${col.generation_expression}${col.is_persisted ? ' persisted' : ''}` : undefined;
98
+ const generated = col.generation_expression
99
+ ? `${col.generation_expression}${col.is_persisted ? ' persisted' : ''}`
100
+ : undefined;
81
101
  let type = col.data_type;
82
102
  if (['varchar', 'nvarchar', 'char', 'nchar', 'varbinary'].includes(col.data_type)) {
83
103
  col.length = col.character_maximum_length;
@@ -97,7 +117,9 @@ export class MsSqlSchemaHelper extends SchemaHelper {
97
117
  ret[key] ??= [];
98
118
  ret[key].push({
99
119
  name: col.column_name,
100
- type: this.platform.isNumericColumn(mappedType) ? col.data_type.replace(/ unsigned$/, '').replace(/\(\d+\)$/, '') : type,
120
+ type: this.platform.isNumericColumn(mappedType)
121
+ ? col.data_type.replace(/ unsigned$/, '').replace(/\(\d+\)$/, '')
122
+ : type,
101
123
  mappedType,
102
124
  unsigned: col.data_type.endsWith(' unsigned'),
103
125
  length: col.length,
@@ -120,26 +142,52 @@ export class MsSqlSchemaHelper extends SchemaHelper {
120
142
  ind.is_primary_key as is_primary_key,
121
143
  col.name as column_name,
122
144
  schema_name(t.schema_id) as schema_name,
123
- (case when filter_definition is not null then concat('where ', filter_definition) else null end) as expression
145
+ (case when filter_definition is not null then concat('where ', filter_definition) else null end) as expression,
146
+ ind.is_disabled as is_disabled,
147
+ ind.type as index_type,
148
+ ind.fill_factor as fill_factor,
149
+ ic.is_included_column as is_included_column,
150
+ ic.is_descending_key as is_descending_key
124
151
  from sys.indexes ind
125
152
  inner join sys.index_columns ic on ind.object_id = ic.object_id and ind.index_id = ic.index_id
126
153
  inner join sys.columns col on ic.object_id = col.object_id and ic.column_id = col.column_id
127
154
  inner join sys.tables t on ind.object_id = t.object_id
128
155
  where
129
156
  (${[...tablesBySchemas.entries()].map(([schema, tables]) => `(t.name in (${tables.map(t => this.platform.quoteValue(t.table_name)).join(',')}) and schema_name(t.schema_id) = '${schema}')`).join(' OR ')})
130
- order by t.name, ind.name, ind.index_id`;
157
+ order by t.name, ind.name, ic.is_included_column, ic.key_ordinal`;
131
158
  const allIndexes = await connection.execute(sql);
132
159
  const ret = {};
133
160
  for (const index of allIndexes) {
134
161
  const key = this.getTableKey(index);
162
+ const isIncluded = index.is_included_column;
135
163
  const indexDef = {
136
- columnNames: [index.column_name],
164
+ columnNames: isIncluded ? [] : [index.column_name],
137
165
  keyName: index.index_name,
138
166
  unique: index.is_unique,
139
167
  primary: index.is_primary_key,
140
168
  constraint: index.is_unique,
141
169
  };
142
- if (!index.column_name || index.column_name.match(/[(): ,"'`]/) || index.expression?.match(/where /i)) {
170
+ // Capture INCLUDE columns
171
+ if (isIncluded) {
172
+ indexDef.include = [index.column_name];
173
+ }
174
+ // Capture sort order for key columns
175
+ if (!isIncluded && index.is_descending_key) {
176
+ indexDef.columns = [{ name: index.column_name, sort: 'DESC' }];
177
+ }
178
+ // Capture disabled flag
179
+ if (index.is_disabled) {
180
+ indexDef.disabled = true;
181
+ }
182
+ // Capture clustered flag (type 1 = clustered)
183
+ if (index.index_type === 1 && !index.is_primary_key) {
184
+ indexDef.clustered = true;
185
+ }
186
+ // Capture fill factor (0 means default, so only set if non-zero)
187
+ if (index.fill_factor > 0) {
188
+ indexDef.fillFactor = index.fill_factor;
189
+ }
190
+ if (index.column_name?.match(/[(): ,"'`]/) || index.expression?.match(/where /i)) {
143
191
  indexDef.expression = index.expression; // required for the `getCreateIndexSQL()` call
144
192
  indexDef.expression = this.getCreateIndexSQL(index.table_name, indexDef, !!index.expression);
145
193
  }
@@ -193,7 +241,9 @@ export class MsSqlSchemaHelper extends SchemaHelper {
193
241
  /* v8 ignore next */
194
242
  const hasItems = (items?.length ?? 0) > 0;
195
243
  if (item.columnName && hasItems) {
196
- items = items.map(val => val.trim().replace(`[${item.columnName}]=`, '').match(/^\(?'(.*)'/)?.[1]).filter(Boolean);
244
+ items = items
245
+ .map(val => /^\(?'(.*)'/.exec(val.trim().replace(`[${item.columnName}]=`, ''))?.[1])
246
+ .filter(Boolean);
197
247
  if (items.length > 0) {
198
248
  o[item.columnName] = items.reverse();
199
249
  }
@@ -266,7 +316,7 @@ export class MsSqlSchemaHelper extends SchemaHelper {
266
316
  }
267
317
  // convert to string first if it's not already a string or has a smaller length
268
318
  const type = this.platform.extractSimpleType(col.fromColumn.type);
269
- if (!['varchar', 'nvarchar', 'varbinary'].includes(type) || (col.fromColumn.length < col.column.length)) {
319
+ if (!['varchar', 'nvarchar', 'varbinary'].includes(type) || col.fromColumn.length < col.column.length) {
270
320
  ret.push(`alter table ${quotedName} alter column [${col.oldColumnName}] nvarchar(max)`);
271
321
  }
272
322
  }
@@ -328,18 +378,21 @@ export class MsSqlSchemaHelper extends SchemaHelper {
328
378
  }
329
379
  const i = globalThis.idx;
330
380
  globalThis.idx++;
331
- constraints.push(`declare @constraint${i} varchar(100) = (select default_constraints.name from sys.all_columns`
332
- + ' join sys.tables on all_columns.object_id = tables.object_id'
333
- + ' join sys.schemas on tables.schema_id = schemas.schema_id'
334
- + ' join sys.default_constraints on all_columns.default_object_id = default_constraints.object_id'
335
- + ` where schemas.name = '${schemaName}' and tables.name = '${tableName}' and all_columns.name = '${column.name}')`
336
- + ` if @constraint${i} is not null exec('alter table ${tableNameRaw} drop constraint ' + @constraint${i})`);
381
+ constraints.push(`declare @constraint${i} varchar(100) = (select default_constraints.name from sys.all_columns` +
382
+ ' join sys.tables on all_columns.object_id = tables.object_id' +
383
+ ' join sys.schemas on tables.schema_id = schemas.schema_id' +
384
+ ' join sys.default_constraints on all_columns.default_object_id = default_constraints.object_id' +
385
+ ` where schemas.name = '${schemaName}' and tables.name = '${tableName}' and all_columns.name = '${column.name}')` +
386
+ ` if @constraint${i} is not null exec('alter table ${tableNameRaw} drop constraint ' + @constraint${i})`);
337
387
  }
338
388
  return constraints;
339
389
  }
340
390
  getRenameColumnSQL(tableName, oldColumnName, to, schemaName) {
341
391
  /* v8 ignore next */
342
- const oldName = (schemaName && schemaName !== this.platform.getDefaultSchemaName() ? schemaName + '.' : '') + tableName + '.' + oldColumnName;
392
+ const oldName = (schemaName && schemaName !== this.platform.getDefaultSchemaName() ? schemaName + '.' : '') +
393
+ tableName +
394
+ '.' +
395
+ oldColumnName;
343
396
  const columnName = this.platform.quoteValue(to.name);
344
397
  return `exec sp_rename ${this.platform.quoteValue(oldName)}, ${columnName}, 'COLUMN'`;
345
398
  }
@@ -348,7 +401,10 @@ export class MsSqlSchemaHelper extends SchemaHelper {
348
401
  const primaryKey = !changedProperties && !this.hasNonDefaultPrimaryKeyName(table);
349
402
  const columnType = column.generated ? `as ${column.generated}` : column.type;
350
403
  const col = [this.quote(column.name)];
351
- if (column.autoincrement && !column.generated && !compositePK && (!changedProperties || changedProperties.has('autoincrement') || changedProperties.has('type'))) {
404
+ if (column.autoincrement &&
405
+ !column.generated &&
406
+ !compositePK &&
407
+ (!changedProperties || changedProperties.has('autoincrement') || changedProperties.has('type'))) {
352
408
  col.push(column.mappedType.getColumnType({ autoincrement: true }, this.platform));
353
409
  }
354
410
  else {
@@ -357,10 +413,15 @@ export class MsSqlSchemaHelper extends SchemaHelper {
357
413
  Utils.runIfNotEmpty(() => col.push('identity(1,1)'), column.autoincrement);
358
414
  Utils.runIfNotEmpty(() => col.push('null'), column.nullable);
359
415
  Utils.runIfNotEmpty(() => col.push('not null'), !column.nullable && !column.generated);
360
- if (column.autoincrement && !column.generated && !compositePK && (!changedProperties || changedProperties.has('autoincrement') || changedProperties.has('type'))) {
416
+ if (column.autoincrement &&
417
+ !column.generated &&
418
+ !compositePK &&
419
+ (!changedProperties || changedProperties.has('autoincrement') || changedProperties.has('type'))) {
361
420
  Utils.runIfNotEmpty(() => col.push('primary key'), primaryKey && column.primary);
362
421
  }
363
- const useDefault = changedProperties ? false : column.default != null && column.default !== 'null' && !column.autoincrement;
422
+ const useDefault = changedProperties
423
+ ? false
424
+ : column.default != null && column.default !== 'null' && !column.autoincrement;
364
425
  const defaultName = this.platform.getConfig().getNamingStrategy().indexName(table.name, [column.name], 'default');
365
426
  Utils.runIfNotEmpty(() => col.push(`constraint ${this.quote(defaultName)} default ${column.default}`), useDefault);
366
427
  return col.join(' ');
@@ -382,17 +443,64 @@ export class MsSqlSchemaHelper extends SchemaHelper {
382
443
  return parts;
383
444
  }
384
445
  getCreateIndexSQL(tableName, index, partialExpression = false) {
385
- /* v8 ignore next 3 */
446
+ /* v8 ignore next */
386
447
  if (index.expression && !partialExpression) {
387
448
  return index.expression;
388
449
  }
450
+ if (index.fillFactor != null && (index.fillFactor < 0 || index.fillFactor > 100)) {
451
+ throw new Error(`fillFactor must be between 0 and 100, got ${index.fillFactor} for index '${index.keyName}'`);
452
+ }
389
453
  const keyName = this.quote(index.keyName);
390
- const defer = index.deferMode ? ` deferrable initially ${index.deferMode}` : '';
391
- const sql = `create ${index.unique ? 'unique ' : ''}index ${keyName} on ${this.quote(tableName)} `;
454
+ // Only add clustered keyword when explicitly requested, otherwise omit (defaults to nonclustered)
455
+ const clustered = index.clustered ? 'clustered ' : '';
456
+ let sql = `create ${index.unique ? 'unique ' : ''}${clustered}index ${keyName} on ${this.quote(tableName)} `;
392
457
  if (index.expression && partialExpression) {
393
- return `${sql}(${index.expression})${defer}`;
458
+ return sql + `(${index.expression})` + this.getMsSqlIndexSuffix(index);
459
+ }
460
+ // Build column list with advanced options
461
+ const columns = this.getIndexColumns(index);
462
+ sql += `(${columns})`;
463
+ // Add INCLUDE clause for covering indexes
464
+ if (index.include?.length) {
465
+ sql += ` include (${index.include.map(c => this.quote(c)).join(', ')})`;
394
466
  }
395
- return super.getCreateIndexSQL(tableName, index);
467
+ sql += this.getMsSqlIndexSuffix(index);
468
+ // Disabled indexes need to be created first, then disabled
469
+ if (index.disabled) {
470
+ sql += `;\nalter index ${keyName} on ${this.quote(tableName)} disable`;
471
+ }
472
+ return sql;
473
+ }
474
+ /**
475
+ * Build the column list for a MSSQL index.
476
+ */
477
+ getIndexColumns(index) {
478
+ if (index.columns?.length) {
479
+ return index.columns
480
+ .map(col => {
481
+ let colDef = this.quote(col.name);
482
+ // MSSQL supports sort order
483
+ if (col.sort) {
484
+ colDef += ` ${col.sort}`;
485
+ }
486
+ return colDef;
487
+ })
488
+ .join(', ');
489
+ }
490
+ return index.columnNames.map(c => this.quote(c)).join(', ');
491
+ }
492
+ /**
493
+ * Get MSSQL-specific index WITH options like fill factor.
494
+ */
495
+ getMsSqlIndexSuffix(index) {
496
+ const withOptions = [];
497
+ if (index.fillFactor != null) {
498
+ withOptions.push(`fillfactor = ${index.fillFactor}`);
499
+ }
500
+ if (withOptions.length > 0) {
501
+ return ` with (${withOptions.join(', ')})`;
502
+ }
503
+ return '';
396
504
  }
397
505
  createIndex(index, table, createPrimary = false) {
398
506
  if (index.primary) {
@@ -401,13 +509,17 @@ export class MsSqlSchemaHelper extends SchemaHelper {
401
509
  if (index.expression) {
402
510
  return index.expression;
403
511
  }
404
- const quotedTableName = table.getQuotedName();
405
- if (index.unique) {
406
- const nullable = index.columnNames.some(column => table.getColumn(column)?.nullable);
407
- const where = nullable ? ' where ' + index.columnNames.map(c => `${this.quote(c)} is not null`).join(' and ') : '';
408
- return `create unique index ${this.quote(index.keyName)} on ${quotedTableName} (${index.columnNames.map(c => this.quote(c)).join(', ')})${where}`;
512
+ const needsWhereClause = index.unique && index.columnNames.some(column => table.getColumn(column)?.nullable);
513
+ if (!needsWhereClause) {
514
+ return this.getCreateIndexSQL(table.getShortestName(), index);
515
+ }
516
+ // Generate without disabled suffix, insert WHERE clause, then re-add disabled
517
+ let sql = this.getCreateIndexSQL(table.getShortestName(), { ...index, disabled: false });
518
+ sql += ' where ' + index.columnNames.map(c => `${this.quote(c)} is not null`).join(' and ');
519
+ if (index.disabled) {
520
+ sql += `;\nalter index ${this.quote(index.keyName)} on ${table.getQuotedName()} disable`;
409
521
  }
410
- return super.createIndex(index, table);
522
+ return sql;
411
523
  }
412
524
  dropForeignKey(tableName, constraintName) {
413
525
  return `alter table ${this.quote(tableName)} drop constraint ${this.quote(constraintName)}`;
@@ -418,10 +530,16 @@ export class MsSqlSchemaHelper extends SchemaHelper {
418
530
  }
419
531
  return `if object_id('${this.quote(schema, name)}', 'U') is not null drop table ${this.quote(schema, name)}`;
420
532
  }
533
+ dropViewIfExists(name, schema) {
534
+ const viewName = this.quote(this.getTableName(name, schema));
535
+ return `if object_id('${viewName}', 'V') is not null drop view ${viewName}`;
536
+ }
421
537
  getAddColumnsSQL(table, columns) {
422
- const adds = columns.map(column => {
423
- return `${this.createTableColumn(column, table)}`;
424
- }).join(', ');
538
+ const adds = columns
539
+ .map(column => {
540
+ return this.createTableColumn(column, table);
541
+ })
542
+ .join(', ');
425
543
  return [`alter table ${table.getQuotedName()} add ${adds}`];
426
544
  }
427
545
  appendComments(table) {
@@ -448,7 +566,7 @@ else
448
566
  return sql;
449
567
  }
450
568
  inferLengthFromColumnType(type) {
451
- const match = type.match(/^(\w+)\s*\(\s*(-?\d+|max)\s*\)/);
569
+ const match = /^(\w+)\s*\(\s*(-?\d+|max)\s*\)/.exec(type);
452
570
  if (!match) {
453
571
  return;
454
572
  }
@@ -458,7 +576,10 @@ else
458
576
  return +match[2];
459
577
  }
460
578
  wrap(val, type) {
461
- const stringType = type instanceof StringType || type instanceof TextType || type instanceof EnumType || type instanceof UnicodeStringType;
579
+ const stringType = type instanceof StringType ||
580
+ type instanceof TextType ||
581
+ type instanceof EnumType ||
582
+ type instanceof UnicodeStringType;
462
583
  return typeof val === 'string' && val.length > 0 && stringType ? this.platform.quoteValue(val) : val;
463
584
  }
464
585
  }
package/README.md CHANGED
@@ -2,14 +2,14 @@
2
2
  <a href="https://mikro-orm.io"><img src="https://raw.githubusercontent.com/mikro-orm/mikro-orm/master/docs/static/img/logo-readme.svg?sanitize=true" alt="MikroORM" /></a>
3
3
  </h1>
4
4
 
5
- TypeScript ORM for Node.js based on Data Mapper, [Unit of Work](https://mikro-orm.io/docs/unit-of-work/) and [Identity Map](https://mikro-orm.io/docs/identity-map/) patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite (including libSQL) databases.
5
+ TypeScript ORM for Node.js based on Data Mapper, [Unit of Work](https://mikro-orm.io/docs/unit-of-work/) and [Identity Map](https://mikro-orm.io/docs/identity-map/) patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL, SQLite (including libSQL), MSSQL and Oracle databases.
6
6
 
7
7
  > Heavily inspired by [Doctrine](https://www.doctrine-project.org/) and [Hibernate](https://hibernate.org/).
8
8
 
9
- [![NPM version](https://img.shields.io/npm/v/@mikro-orm/core.svg)](https://www.npmjs.com/package/@mikro-orm/core)
10
- [![NPM dev version](https://img.shields.io/npm/v/@mikro-orm/core/next.svg)](https://www.npmjs.com/package/@mikro-orm/core)
9
+ [![NPM version](https://img.shields.io/npm/v/@mikro-orm/core.svg)](https://npmx.dev/package/@mikro-orm/core)
10
+ [![NPM dev version](https://img.shields.io/npm/v/@mikro-orm/core/next.svg)](https://npmx.dev/package/@mikro-orm/core)
11
11
  [![Chat on discord](https://img.shields.io/discord/1214904142443839538?label=discord&color=blue)](https://discord.gg/w8bjxFHS7X)
12
- [![Downloads](https://img.shields.io/npm/dm/@mikro-orm/core.svg)](https://www.npmjs.com/package/@mikro-orm/core)
12
+ [![Downloads](https://img.shields.io/npm/dm/@mikro-orm/core.svg)](https://npmx.dev/package/@mikro-orm/core)
13
13
  [![Coverage Status](https://img.shields.io/coveralls/mikro-orm/mikro-orm.svg)](https://coveralls.io/r/mikro-orm/mikro-orm?branch=master)
14
14
  [![Build Status](https://github.com/mikro-orm/mikro-orm/workflows/tests/badge.svg?branch=master)](https://github.com/mikro-orm/mikro-orm/actions?workflow=tests)
15
15
 
@@ -181,6 +181,7 @@ yarn add @mikro-orm/core @mikro-orm/mysql # for mysql/mariadb
181
181
  yarn add @mikro-orm/core @mikro-orm/mariadb # for mysql/mariadb
182
182
  yarn add @mikro-orm/core @mikro-orm/postgresql # for postgresql
183
183
  yarn add @mikro-orm/core @mikro-orm/mssql # for mssql
184
+ yarn add @mikro-orm/core @mikro-orm/oracledb # for oracle
184
185
  yarn add @mikro-orm/core @mikro-orm/sqlite # for sqlite
185
186
  yarn add @mikro-orm/core @mikro-orm/libsql # for libsql
186
187
  ```
@@ -381,6 +382,8 @@ See also the list of contributors who [participated](https://github.com/mikro-or
381
382
 
382
383
  Please ⭐️ this repository if this project helped you!
383
384
 
385
+ > If you'd like to support my open-source work, consider sponsoring me directly at [github.com/sponsors/b4nan](https://github.com/sponsors/b4nan).
386
+
384
387
  ## 📝 License
385
388
 
386
389
  Copyright © 2018 [Martin Adámek](https://github.com/b4nan).
@@ -23,7 +23,7 @@ export class UnicodeStringType extends Type {
23
23
  return `nvarchar(${length})`;
24
24
  }
25
25
  convertToJSValue(value) {
26
- /* v8 ignore next 3 */
26
+ /* v8 ignore next */
27
27
  if (value instanceof UnicodeString) {
28
28
  return value.value;
29
29
  }
package/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- export * from '@mikro-orm/knex';
1
+ export * from '@mikro-orm/sql';
2
2
  export * from './MsSqlConnection.js';
3
3
  export * from './MsSqlDriver.js';
4
4
  export * from './MsSqlPlatform.js';
5
5
  export * from './MsSqlSchemaHelper.js';
6
- export * from './MsSqlExceptionConverter.js';
7
6
  export * from './UnicodeStringType.js';
8
- export { MsSqlMikroORM as MikroORM, MsSqlOptions as Options, defineMsSqlConfig as defineConfig, } from './MsSqlMikroORM.js';
7
+ export { MsSqlMikroORM as MikroORM, type MsSqlOptions as Options, defineMsSqlConfig as defineConfig, } from './MsSqlMikroORM.js';
package/index.js CHANGED
@@ -1,8 +1,7 @@
1
- export * from '@mikro-orm/knex';
1
+ export * from '@mikro-orm/sql';
2
2
  export * from './MsSqlConnection.js';
3
3
  export * from './MsSqlDriver.js';
4
4
  export * from './MsSqlPlatform.js';
5
5
  export * from './MsSqlSchemaHelper.js';
6
- export * from './MsSqlExceptionConverter.js';
7
6
  export * from './UnicodeStringType.js';
8
7
  export { MsSqlMikroORM as MikroORM, defineMsSqlConfig as defineConfig, } from './MsSqlMikroORM.js';
package/package.json CHANGED
@@ -1,66 +1,65 @@
1
1
  {
2
2
  "name": "@mikro-orm/mssql",
3
- "type": "module",
4
- "version": "7.0.0-dev.32",
3
+ "version": "7.0.0-dev.320",
5
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.",
6
- "exports": {
7
- "./package.json": "./package.json",
8
- ".": "./index.js"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+ssh://git@github.com/mikro-orm/mikro-orm.git"
13
- },
14
5
  "keywords": [
15
- "orm",
6
+ "data-mapper",
7
+ "ddd",
8
+ "entity",
9
+ "identity-map",
10
+ "javascript",
11
+ "js",
12
+ "mariadb",
13
+ "mikro-orm",
16
14
  "mongo",
17
15
  "mongodb",
18
16
  "mysql",
19
- "mariadb",
17
+ "orm",
20
18
  "postgresql",
21
19
  "sqlite",
22
20
  "sqlite3",
23
21
  "ts",
24
22
  "typescript",
25
- "js",
26
- "javascript",
27
- "entity",
28
- "ddd",
29
- "mikro-orm",
30
- "unit-of-work",
31
- "data-mapper",
32
- "identity-map"
23
+ "unit-of-work"
33
24
  ],
34
- "author": "Martin Adámek",
35
- "license": "MIT",
25
+ "homepage": "https://mikro-orm.io",
36
26
  "bugs": {
37
27
  "url": "https://github.com/mikro-orm/mikro-orm/issues"
38
28
  },
39
- "homepage": "https://mikro-orm.io",
40
- "engines": {
41
- "node": ">= 22.11.0"
29
+ "license": "MIT",
30
+ "author": "Martin Adámek",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+ssh://git@github.com/mikro-orm/mikro-orm.git"
34
+ },
35
+ "type": "module",
36
+ "exports": {
37
+ "./package.json": "./package.json",
38
+ ".": "./index.js"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
42
  },
43
43
  "scripts": {
44
- "build": "yarn clean && yarn compile && yarn copy",
44
+ "build": "yarn compile && yarn copy",
45
45
  "clean": "yarn run -T rimraf ./dist",
46
46
  "compile": "yarn run -T tsc -p tsconfig.build.json",
47
47
  "copy": "node ../../scripts/copy.mjs"
48
48
  },
49
- "publishConfig": {
50
- "access": "public"
51
- },
52
49
  "dependencies": {
53
- "@mikro-orm/knex": "7.0.0-dev.32",
50
+ "@mikro-orm/sql": "7.0.0-dev.320",
51
+ "kysely": "0.28.11",
54
52
  "tarn": "3.0.2",
55
- "tedious": "19.0.0",
53
+ "tedious": "19.2.1",
56
54
  "tsqlstring": "1.0.1"
57
55
  },
58
56
  "devDependencies": {
59
- "@mikro-orm/core": "^6.5.7",
60
- "kysely": "0.28.7"
57
+ "@mikro-orm/core": "^6.6.9"
61
58
  },
62
59
  "peerDependencies": {
63
- "@mikro-orm/core": "7.0.0-dev.32",
64
- "kysely": "*"
60
+ "@mikro-orm/core": "7.0.0-dev.320"
61
+ },
62
+ "engines": {
63
+ "node": ">= 22.17.0"
65
64
  }
66
65
  }