@mikro-orm/mssql 7.2.0-dev.0 → 7.2.0-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/MsSqlPlatform.js CHANGED
@@ -223,18 +223,19 @@ export class MsSqlPlatform extends AbstractSqlPlatform {
223
223
  return collation;
224
224
  }
225
225
  getOrderByExpression(column, direction, collation) {
226
+ const dir = this.validateOrderByDirection(direction);
226
227
  const col = collation ? `${column} collate ${this.quoteCollation(collation)}` : column;
227
- switch (direction.toUpperCase()) {
228
- case QueryOrder.ASC_NULLS_FIRST:
228
+ switch (dir) {
229
+ case QueryOrder.asc_nulls_first:
229
230
  return [`case when ${column} is null then 0 else 1 end, ${col} asc`];
230
- case QueryOrder.ASC_NULLS_LAST:
231
+ case QueryOrder.asc_nulls_last:
231
232
  return [`case when ${column} is null then 1 else 0 end, ${col} asc`];
232
- case QueryOrder.DESC_NULLS_FIRST:
233
+ case QueryOrder.desc_nulls_first:
233
234
  return [`case when ${column} is null then 0 else 1 end, ${col} desc`];
234
- case QueryOrder.DESC_NULLS_LAST:
235
+ case QueryOrder.desc_nulls_last:
235
236
  return [`case when ${column} is null then 1 else 0 end, ${col} desc`];
236
237
  default:
237
- return [`${col} ${direction.toLowerCase()}`];
238
+ return [`${col} ${dir}`];
238
239
  }
239
240
  }
240
241
  getDefaultClientUrl() {
@@ -400,6 +400,7 @@ export class MsSqlSchemaHelper extends SchemaHelper {
400
400
  on ep.major_id = o.object_id and ep.minor_id = 0 and ep.name = 'MS_Description'
401
401
  where o.type in ('P', 'FN', 'IF', 'TF')
402
402
  and o.is_ms_shipped = 0
403
+ order by s.name, o.name
403
404
  `;
404
405
  const [rows, paramsAndReturns] = await Promise.all([
405
406
  connection.execute(sql),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mssql",
3
- "version": "7.2.0-dev.0",
3
+ "version": "7.2.0-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
  "keywords": [
6
6
  "data-mapper",
@@ -47,17 +47,17 @@
47
47
  "copy": "node ../../scripts/copy.mjs"
48
48
  },
49
49
  "dependencies": {
50
- "@mikro-orm/sql": "7.2.0-dev.0",
51
- "kysely": "0.29.3",
50
+ "@mikro-orm/sql": "7.2.0-dev.2",
51
+ "kysely": "0.29.4",
52
52
  "tarn": "3.1.2",
53
53
  "tedious": "20.0.0",
54
54
  "tsqlstring": "1.0.1"
55
55
  },
56
56
  "devDependencies": {
57
- "@mikro-orm/core": "^7.1.6"
57
+ "@mikro-orm/core": "^7.1.7"
58
58
  },
59
59
  "peerDependencies": {
60
- "@mikro-orm/core": "7.2.0-dev.0"
60
+ "@mikro-orm/core": "7.2.0-dev.2"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">= 22.17.0"