@mikro-orm/mssql 7.2.2-dev.6 → 7.2.2-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.
- package/MsSqlDriver.d.ts +2 -1
- package/MsSqlDriver.js +10 -0
- package/package.json +3 -3
package/MsSqlDriver.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AnyEntity, type Configuration, type ConnectionType, type EntityDictionary, type EntityName, type LoggingOptions, type NativeInsertUpdateManyOptions, type QueryResult, type Transaction, type Constructor } from '@mikro-orm/core';
|
|
1
|
+
import { type AnyEntity, type Configuration, type ConnectionType, type EntityDictionary, type EntityName, type LoggingOptions, type NativeInsertUpdateManyOptions, type QueryResult, type Transaction, type Constructor, type FilterQuery, type UpsertManyOptions } from '@mikro-orm/core';
|
|
2
2
|
import { AbstractSqlDriver, type SqlEntityManager } from '@mikro-orm/sql';
|
|
3
3
|
import { MsSqlConnection } from './MsSqlConnection.js';
|
|
4
4
|
import { MsSqlQueryBuilder } from './MsSqlQueryBuilder.js';
|
|
@@ -7,6 +7,7 @@ import { MsSqlMikroORM } from './MsSqlMikroORM.js';
|
|
|
7
7
|
export declare class MsSqlDriver extends AbstractSqlDriver<MsSqlConnection> {
|
|
8
8
|
constructor(config: Configuration);
|
|
9
9
|
nativeInsertMany<T extends AnyEntity<T>>(entityName: EntityName<T>, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
|
10
|
+
nativeUpdateMany<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>[], data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T> & UpsertManyOptions<T>): Promise<QueryResult<T>>;
|
|
10
11
|
createQueryBuilder<T extends AnyEntity<T>>(entityName: EntityName<T>, ctx?: Transaction, preferredConnectionType?: ConnectionType, convertCustomTypes?: boolean, loggerContext?: LoggingOptions, alias?: string, em?: SqlEntityManager): MsSqlQueryBuilder<T, any, any, any>;
|
|
11
12
|
private appendOutputTable;
|
|
12
13
|
/** @inheritDoc */
|
package/MsSqlDriver.js
CHANGED
|
@@ -54,6 +54,16 @@ export class MsSqlDriver extends AbstractSqlDriver {
|
|
|
54
54
|
return sql;
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
+
async nativeUpdateMany(entityName, where, data, options = {}) {
|
|
58
|
+
const meta = this.metadata.get(entityName);
|
|
59
|
+
return super.nativeUpdateMany(entityName, where, data, options, sql => {
|
|
60
|
+
if (!meta.hasTriggers) {
|
|
61
|
+
return sql;
|
|
62
|
+
}
|
|
63
|
+
const fields = this.getUpdateReturningProperties(meta, data).flatMap(prop => prop.fieldNames);
|
|
64
|
+
return this.appendOutputTable(entityName, fields, sql, sql.lastIndexOf(' where '), options);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
57
67
|
createQueryBuilder(entityName, ctx, preferredConnectionType, convertCustomTypes, loggerContext, alias, em) {
|
|
58
68
|
// do not compute the connectionType if EM is provided as it will be computed from it in the QB later on
|
|
59
69
|
const connectionType = em
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/mssql",
|
|
3
|
-
"version": "7.2.2-dev.
|
|
3
|
+
"version": "7.2.2-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.2.2-dev.
|
|
50
|
+
"@mikro-orm/sql": "7.2.2-dev.8",
|
|
51
51
|
"kysely": "0.29.6",
|
|
52
52
|
"tarn": "3.1.2",
|
|
53
53
|
"tedious": "20.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@mikro-orm/core": "^7.2.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@mikro-orm/core": "7.2.2-dev.
|
|
60
|
+
"@mikro-orm/core": "7.2.2-dev.8"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">= 22.17.0"
|