@mikro-orm/mssql 6.4.14-dev.2 → 6.4.14-dev.20
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.d.ts +2 -1
- package/MsSqlPlatform.js +14 -0
- package/package.json +3 -3
package/MsSqlPlatform.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbstractSqlPlatform, type EntityMetadata, type IDatabaseDriver, type EntityManager, type MikroORM, Type, type Primary, type IPrimaryKey } from '@mikro-orm/knex';
|
|
1
|
+
import { AbstractSqlPlatform, type EntityMetadata, type IDatabaseDriver, type EntityManager, type MikroORM, Type, type Primary, type IPrimaryKey, QueryOrder } from '@mikro-orm/knex';
|
|
2
2
|
import { MsSqlSchemaHelper } from './MsSqlSchemaHelper';
|
|
3
3
|
import { MsSqlExceptionConverter } from './MsSqlExceptionConverter';
|
|
4
4
|
import { MsSqlSchemaGenerator } from './MsSqlSchemaGenerator';
|
|
@@ -54,4 +54,5 @@ export declare class MsSqlPlatform extends AbstractSqlPlatform {
|
|
|
54
54
|
escape(value: any): string;
|
|
55
55
|
getSchemaGenerator(driver: IDatabaseDriver, em?: EntityManager): MsSqlSchemaGenerator;
|
|
56
56
|
allowsComparingTuples(): boolean;
|
|
57
|
+
getOrderByExpression(column: string, direction: QueryOrder): string[];
|
|
57
58
|
}
|
package/MsSqlPlatform.js
CHANGED
|
@@ -186,5 +186,19 @@ class MsSqlPlatform extends knex_1.AbstractSqlPlatform {
|
|
|
186
186
|
allowsComparingTuples() {
|
|
187
187
|
return false;
|
|
188
188
|
}
|
|
189
|
+
getOrderByExpression(column, direction) {
|
|
190
|
+
switch (direction.toUpperCase()) {
|
|
191
|
+
case knex_1.QueryOrder.ASC_NULLS_FIRST:
|
|
192
|
+
return [`case when ${column} is null then 0 else 1 end, ${column} asc`];
|
|
193
|
+
case knex_1.QueryOrder.ASC_NULLS_LAST:
|
|
194
|
+
return [`case when ${column} is null then 1 else 0 end, ${column} asc`];
|
|
195
|
+
case knex_1.QueryOrder.DESC_NULLS_FIRST:
|
|
196
|
+
return [`case when ${column} is null then 0 else 1 end, ${column} desc`];
|
|
197
|
+
case knex_1.QueryOrder.DESC_NULLS_LAST:
|
|
198
|
+
return [`case when ${column} is null then 1 else 0 end, ${column} desc`];
|
|
199
|
+
default:
|
|
200
|
+
return [`${column} ${direction.toLowerCase()}`];
|
|
201
|
+
}
|
|
202
|
+
}
|
|
189
203
|
}
|
|
190
204
|
exports.MsSqlPlatform = MsSqlPlatform;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/mssql",
|
|
3
|
-
"version": "6.4.14-dev.
|
|
3
|
+
"version": "6.4.14-dev.20",
|
|
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.4.14-dev.
|
|
61
|
+
"@mikro-orm/knex": "6.4.14-dev.20",
|
|
62
62
|
"tedious": "19.0.0",
|
|
63
63
|
"tsqlstring": "1.0.1"
|
|
64
64
|
},
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"@mikro-orm/core": "^6.4.13"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.4.14-dev.
|
|
69
|
+
"@mikro-orm/core": "6.4.14-dev.20"
|
|
70
70
|
}
|
|
71
71
|
}
|