@mikro-orm/mysql 7.0.0-dev.114 → 7.0.0-dev.115
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/MySqlDriver.d.ts +3 -3
- package/MySqlDriver.js +5 -4
- package/package.json +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
package/MySqlDriver.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Configuration, Constructor, EntityDictionary, EntityName, FilterQuery, NativeInsertUpdateManyOptions, QueryResult, UpsertManyOptions } from '@mikro-orm/core';
|
|
2
2
|
import { AbstractSqlDriver } from '@mikro-orm/sql';
|
|
3
3
|
import { MySqlConnection } from './MySqlConnection.js';
|
|
4
4
|
import { MySqlMikroORM } from './MySqlMikroORM.js';
|
|
@@ -7,8 +7,8 @@ export declare class MySqlDriver extends AbstractSqlDriver<MySqlConnection, MySq
|
|
|
7
7
|
protected autoIncrementIncrement?: number;
|
|
8
8
|
constructor(config: Configuration);
|
|
9
9
|
private getAutoIncrementIncrement;
|
|
10
|
-
nativeInsertMany<T extends object>(entityName:
|
|
11
|
-
nativeUpdateMany<T extends object>(entityName:
|
|
10
|
+
nativeInsertMany<T extends object>(entityName: EntityName<T>, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
|
11
|
+
nativeUpdateMany<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>[], data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T> & UpsertManyOptions<T>): Promise<QueryResult<T>>;
|
|
12
12
|
/** @inheritDoc */
|
|
13
13
|
getORMClass(): Constructor<MySqlMikroORM>;
|
|
14
14
|
}
|
package/MySqlDriver.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AbstractSqlDriver } from '@mikro-orm/sql';
|
|
1
|
+
import { AbstractSqlDriver, Utils } from '@mikro-orm/sql';
|
|
3
2
|
import { MySqlConnection } from './MySqlConnection.js';
|
|
4
3
|
import { MySqlMikroORM } from './MySqlMikroORM.js';
|
|
5
4
|
import { MySqlPlatform } from './MySqlPlatform.js';
|
|
@@ -20,7 +19,8 @@ export class MySqlDriver extends AbstractSqlDriver {
|
|
|
20
19
|
async nativeInsertMany(entityName, data, options = {}) {
|
|
21
20
|
options.processCollections ??= true;
|
|
22
21
|
const res = await super.nativeInsertMany(entityName, data, options);
|
|
23
|
-
const
|
|
22
|
+
const meta = this.metadata.get(entityName);
|
|
23
|
+
const pks = this.getPrimaryKeyFields(meta);
|
|
24
24
|
const ctx = options.ctx;
|
|
25
25
|
const autoIncrementIncrement = await this.getAutoIncrementIncrement(ctx);
|
|
26
26
|
data.forEach((item, idx) => res.rows[idx] = { [pks[0]]: item[pks[0]] ?? res.insertId + (idx * autoIncrementIncrement) });
|
|
@@ -29,7 +29,8 @@ export class MySqlDriver extends AbstractSqlDriver {
|
|
|
29
29
|
}
|
|
30
30
|
async nativeUpdateMany(entityName, where, data, options = {}) {
|
|
31
31
|
const res = await super.nativeUpdateMany(entityName, where, data, options);
|
|
32
|
-
const
|
|
32
|
+
const meta = this.metadata.get(entityName);
|
|
33
|
+
const pks = this.getPrimaryKeyFields(meta);
|
|
33
34
|
const ctx = options.ctx;
|
|
34
35
|
const autoIncrementIncrement = await this.getAutoIncrementIncrement(ctx);
|
|
35
36
|
let i = 0;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/mysql",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.115",
|
|
5
5
|
"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.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@mikro-orm/sql": "7.0.0-dev.
|
|
53
|
+
"@mikro-orm/sql": "7.0.0-dev.115",
|
|
54
54
|
"kysely": "0.28.9",
|
|
55
55
|
"mysql2": "3.15.3",
|
|
56
56
|
"sqlstring": "2.3.3"
|
|
@@ -59,6 +59,6 @@
|
|
|
59
59
|
"@mikro-orm/core": "^6.6.2"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
62
|
+
"@mikro-orm/core": "7.0.0-dev.115"
|
|
63
63
|
}
|
|
64
64
|
}
|