@mikro-orm/mariadb 6.2.10-dev.9 → 6.2.10-dev.90
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/MariaDbDriver.d.ts +2 -1
- package/MariaDbDriver.js +21 -0
- package/MariaDbMikroORM.js +2 -2
- package/MariaDbSchemaHelper.js +1 -1
- package/index.mjs +1 -0
- package/package.json +4 -4
package/MariaDbDriver.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AnyEntity, type Configuration, type ConnectionType, type EntityDictionary, type LoggingOptions, type NativeInsertUpdateManyOptions, type QueryResult, type Transaction } from '@mikro-orm/core';
|
|
1
|
+
import { type AnyEntity, type Configuration, type ConnectionType, type EntityDictionary, type LoggingOptions, type NativeInsertUpdateManyOptions, type QueryResult, type Transaction, type FilterQuery, type UpsertManyOptions } from '@mikro-orm/core';
|
|
2
2
|
import { AbstractSqlDriver, type Knex, type SqlEntityManager } from '@mikro-orm/knex';
|
|
3
3
|
import { MariaDbConnection } from './MariaDbConnection';
|
|
4
4
|
import { MariaDbPlatform } from './MariaDbPlatform';
|
|
@@ -8,5 +8,6 @@ export declare class MariaDbDriver extends AbstractSqlDriver<MariaDbConnection,
|
|
|
8
8
|
constructor(config: Configuration);
|
|
9
9
|
private getAutoIncrementIncrement;
|
|
10
10
|
nativeInsertMany<T extends object>(entityName: string, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
|
11
|
+
nativeUpdateMany<T extends object>(entityName: string, where: FilterQuery<T>[], data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T> & UpsertManyOptions<T>): Promise<QueryResult<T>>;
|
|
11
12
|
createQueryBuilder<T extends AnyEntity<T>>(entityName: string, ctx?: Transaction<Knex.Transaction>, preferredConnectionType?: ConnectionType, convertCustomTypes?: boolean, loggerContext?: LoggingOptions, alias?: string, em?: SqlEntityManager): MariaDbQueryBuilder<T, any, any, any>;
|
|
12
13
|
}
|
package/MariaDbDriver.js
CHANGED
|
@@ -30,6 +30,27 @@ class MariaDbDriver extends knex_1.AbstractSqlDriver {
|
|
|
30
30
|
res.row = res.rows[0];
|
|
31
31
|
return res;
|
|
32
32
|
}
|
|
33
|
+
async nativeUpdateMany(entityName, where, data, options = {}) {
|
|
34
|
+
const res = await super.nativeUpdateMany(entityName, where, data, options);
|
|
35
|
+
const pks = this.getPrimaryKeyFields(entityName);
|
|
36
|
+
const ctx = options.ctx;
|
|
37
|
+
const autoIncrementIncrement = await this.getAutoIncrementIncrement(ctx);
|
|
38
|
+
let i = 0;
|
|
39
|
+
const rows = where.map(cond => {
|
|
40
|
+
if (res.insertId != null && core_1.Utils.isEmpty(cond)) {
|
|
41
|
+
return { [pks[0]]: res.insertId + (i++ * autoIncrementIncrement) };
|
|
42
|
+
}
|
|
43
|
+
if (cond[pks[0]] == null) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
return { [pks[0]]: cond[pks[0]] };
|
|
47
|
+
});
|
|
48
|
+
if (rows.every(i => i !== undefined)) {
|
|
49
|
+
res.rows = rows;
|
|
50
|
+
}
|
|
51
|
+
res.row = res.rows[0];
|
|
52
|
+
return res;
|
|
53
|
+
}
|
|
33
54
|
createQueryBuilder(entityName, ctx, preferredConnectionType, convertCustomTypes, loggerContext, alias, em) {
|
|
34
55
|
// do not compute the connectionType if EM is provided as it will be computed from it in the QB later on
|
|
35
56
|
const connectionType = em ? preferredConnectionType : this.resolveConnectionType({ ctx, connectionType: preferredConnectionType });
|
package/MariaDbMikroORM.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MariaDbMikroORM = void 0;
|
|
4
|
+
exports.defineMariaDbConfig = defineMariaDbConfig;
|
|
4
5
|
const core_1 = require("@mikro-orm/core");
|
|
5
6
|
const MariaDbDriver_1 = require("./MariaDbDriver");
|
|
6
7
|
/**
|
|
@@ -26,4 +27,3 @@ exports.MariaDbMikroORM = MariaDbMikroORM;
|
|
|
26
27
|
function defineMariaDbConfig(options) {
|
|
27
28
|
return (0, core_1.defineConfig)({ driver: MariaDbDriver_1.MariaDbDriver, ...options });
|
|
28
29
|
}
|
|
29
|
-
exports.defineMariaDbConfig = defineMariaDbConfig;
|
package/MariaDbSchemaHelper.js
CHANGED
|
@@ -48,7 +48,7 @@ class MariaDbSchemaHelper extends knex_1.MySqlSchemaHelper {
|
|
|
48
48
|
nullif(table_schema, schema()) as schema_name,
|
|
49
49
|
column_name as column_name,
|
|
50
50
|
column_default as column_default,
|
|
51
|
-
column_comment as column_comment,
|
|
51
|
+
nullif(column_comment, '') as column_comment,
|
|
52
52
|
is_nullable as is_nullable,
|
|
53
53
|
data_type as data_type,
|
|
54
54
|
column_type as column_type,
|
package/index.mjs
CHANGED
|
@@ -33,6 +33,7 @@ export const ChangeSet = mod.ChangeSet;
|
|
|
33
33
|
export const ChangeSetComputer = mod.ChangeSetComputer;
|
|
34
34
|
export const ChangeSetPersister = mod.ChangeSetPersister;
|
|
35
35
|
export const ChangeSetType = mod.ChangeSetType;
|
|
36
|
+
export const CharacterType = mod.CharacterType;
|
|
36
37
|
export const Check = mod.Check;
|
|
37
38
|
export const CheckConstraintViolationException = mod.CheckConstraintViolationException;
|
|
38
39
|
export const Collection = mod.Collection;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/mariadb",
|
|
3
|
-
"version": "6.2.10-dev.
|
|
3
|
+
"version": "6.2.10-dev.90",
|
|
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,13 +58,13 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/knex": "6.2.10-dev.
|
|
62
|
-
"mariadb": "3.3.
|
|
61
|
+
"@mikro-orm/knex": "6.2.10-dev.90",
|
|
62
|
+
"mariadb": "3.3.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@mikro-orm/core": "^6.2.9"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@mikro-orm/core": "6.2.10-dev.
|
|
68
|
+
"@mikro-orm/core": "6.2.10-dev.90"
|
|
69
69
|
}
|
|
70
70
|
}
|