@mikro-orm/mssql 7.1.7-dev.6 → 7.1.7-dev.8

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.
Files changed (2) hide show
  1. package/MsSqlPlatform.js +7 -6
  2. package/package.json +3 -3
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() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mssql",
3
- "version": "7.1.7-dev.6",
3
+ "version": "7.1.7-dev.8",
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,7 +47,7 @@
47
47
  "copy": "node ../../scripts/copy.mjs"
48
48
  },
49
49
  "dependencies": {
50
- "@mikro-orm/sql": "7.1.7-dev.6",
50
+ "@mikro-orm/sql": "7.1.7-dev.8",
51
51
  "kysely": "0.29.3",
52
52
  "tarn": "3.1.2",
53
53
  "tedious": "20.0.0",
@@ -57,7 +57,7 @@
57
57
  "@mikro-orm/core": "^7.1.6"
58
58
  },
59
59
  "peerDependencies": {
60
- "@mikro-orm/core": "7.1.7-dev.6"
60
+ "@mikro-orm/core": "7.1.7-dev.8"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">= 22.17.0"