@mikro-orm/mssql 6.6.15 → 6.6.16-dev.1

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
@@ -196,17 +196,18 @@ class MsSqlPlatform extends knex_1.AbstractSqlPlatform {
196
196
  return false;
197
197
  }
198
198
  getOrderByExpression(column, direction) {
199
- switch (direction.toUpperCase()) {
200
- case knex_1.QueryOrder.ASC_NULLS_FIRST:
199
+ const dir = this.validateOrderByDirection(direction);
200
+ switch (dir) {
201
+ case knex_1.QueryOrder.asc_nulls_first:
201
202
  return [`case when ${column} is null then 0 else 1 end, ${column} asc`];
202
- case knex_1.QueryOrder.ASC_NULLS_LAST:
203
+ case knex_1.QueryOrder.asc_nulls_last:
203
204
  return [`case when ${column} is null then 1 else 0 end, ${column} asc`];
204
- case knex_1.QueryOrder.DESC_NULLS_FIRST:
205
+ case knex_1.QueryOrder.desc_nulls_first:
205
206
  return [`case when ${column} is null then 0 else 1 end, ${column} desc`];
206
- case knex_1.QueryOrder.DESC_NULLS_LAST:
207
+ case knex_1.QueryOrder.desc_nulls_last:
207
208
  return [`case when ${column} is null then 1 else 0 end, ${column} desc`];
208
209
  default:
209
- return [`${column} ${direction.toLowerCase()}`];
210
+ return [`${column} ${dir}`];
210
211
  }
211
212
  }
212
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mssql",
3
- "version": "6.6.15",
3
+ "version": "6.6.16-dev.1",
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.6.15",
61
+ "@mikro-orm/knex": "6.6.16-dev.1",
62
62
  "tedious": "19.2.1",
63
63
  "tsqlstring": "1.0.1"
64
64
  },
@@ -66,6 +66,6 @@
66
66
  "@mikro-orm/core": "^6.6.15"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "^6.0.0"
69
+ "@mikro-orm/core": "6.6.16-dev.1"
70
70
  }
71
71
  }