@mikro-orm/mariadb 6.4.7-dev.1 → 7.0.0-dev.0
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 +5 -9
- package/MariaDbDriver.js +4 -45
- package/MariaDbMikroORM.d.ts +1 -1
- package/MariaDbPlatform.d.ts +2 -4
- package/MariaDbPlatform.js +8 -7
- package/MariaDbQueryBuilder.d.ts +1 -1
- package/MariaDbQueryBuilder.js +8 -8
- package/MariaDbSchemaHelper.d.ts +1 -2
- package/MariaDbSchemaHelper.js +2 -7
- package/README.md +0 -2
- package/index.d.ts +1 -3
- package/index.js +1 -3
- package/index.mjs +11 -14
- package/package.json +5 -6
- package/MariaDbConnection.d.ts +0 -5
- package/MariaDbConnection.js +0 -17
- package/MariaDbExceptionConverter.d.ts +0 -9
- package/MariaDbExceptionConverter.js +0 -83
package/MariaDbDriver.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { type AnyEntity, type Configuration, type ConnectionType, type
|
|
2
|
-
import {
|
|
3
|
-
import { MariaDbConnection } from './MariaDbConnection';
|
|
1
|
+
import { type AnyEntity, type Configuration, type ConnectionType, type LoggingOptions, type Transaction } from '@mikro-orm/core';
|
|
2
|
+
import { MySqlDriver, type SqlEntityManager } from '@mikro-orm/mysql';
|
|
4
3
|
import { MariaDbPlatform } from './MariaDbPlatform';
|
|
5
4
|
import { MariaDbQueryBuilder } from './MariaDbQueryBuilder';
|
|
6
|
-
export declare class MariaDbDriver extends
|
|
7
|
-
|
|
5
|
+
export declare class MariaDbDriver extends MySqlDriver {
|
|
6
|
+
readonly platform: MariaDbPlatform;
|
|
8
7
|
constructor(config: Configuration);
|
|
9
|
-
|
|
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>>;
|
|
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>;
|
|
8
|
+
createQueryBuilder<T extends AnyEntity<T>>(entityName: string, ctx?: Transaction, preferredConnectionType?: ConnectionType, convertCustomTypes?: boolean, loggerContext?: LoggingOptions, alias?: string, em?: SqlEntityManager): MariaDbQueryBuilder<T, any, any, any>;
|
|
13
9
|
}
|
package/MariaDbDriver.js
CHANGED
|
@@ -2,54 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MariaDbDriver = void 0;
|
|
4
4
|
const core_1 = require("@mikro-orm/core");
|
|
5
|
-
const
|
|
6
|
-
const MariaDbConnection_1 = require("./MariaDbConnection");
|
|
5
|
+
const mysql_1 = require("@mikro-orm/mysql");
|
|
7
6
|
const MariaDbPlatform_1 = require("./MariaDbPlatform");
|
|
8
7
|
const MariaDbQueryBuilder_1 = require("./MariaDbQueryBuilder");
|
|
9
|
-
class MariaDbDriver extends
|
|
10
|
-
autoIncrementIncrement;
|
|
8
|
+
class MariaDbDriver extends mysql_1.MySqlDriver {
|
|
11
9
|
constructor(config) {
|
|
12
|
-
super(config
|
|
13
|
-
|
|
14
|
-
async getAutoIncrementIncrement(ctx) {
|
|
15
|
-
if (this.autoIncrementIncrement == null) {
|
|
16
|
-
// the increment step may differ when running a cluster, see https://github.com/mikro-orm/mikro-orm/issues/3828
|
|
17
|
-
const res = await this.connection.execute(`show variables like 'auto_increment_increment'`, [], 'get', ctx, { enabled: false });
|
|
18
|
-
/* istanbul ignore next */
|
|
19
|
-
this.autoIncrementIncrement = res?.Value ? +res?.Value : 1;
|
|
20
|
-
}
|
|
21
|
-
return this.autoIncrementIncrement;
|
|
22
|
-
}
|
|
23
|
-
async nativeInsertMany(entityName, data, options = {}) {
|
|
24
|
-
options.processCollections ??= true;
|
|
25
|
-
const res = await super.nativeInsertMany(entityName, data, options);
|
|
26
|
-
const pks = this.getPrimaryKeyFields(entityName);
|
|
27
|
-
const ctx = options.ctx;
|
|
28
|
-
const autoIncrementIncrement = await this.getAutoIncrementIncrement(ctx);
|
|
29
|
-
data.forEach((item, idx) => res.rows[idx] = { [pks[0]]: item[pks[0]] ?? res.insertId + (idx * autoIncrementIncrement) });
|
|
30
|
-
res.row = res.rows[0];
|
|
31
|
-
return res;
|
|
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;
|
|
10
|
+
super(config);
|
|
11
|
+
this.platform = new MariaDbPlatform_1.MariaDbPlatform();
|
|
53
12
|
}
|
|
54
13
|
createQueryBuilder(entityName, ctx, preferredConnectionType, convertCustomTypes, loggerContext, alias, em) {
|
|
55
14
|
// do not compute the connectionType if EM is provided as it will be computed from it in the QB later on
|
package/MariaDbMikroORM.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MikroORM, type Options, type IDatabaseDriver, type EntityManager, type EntityManagerType } from '@mikro-orm/core';
|
|
2
|
+
import type { SqlEntityManager } from '@mikro-orm/mysql';
|
|
2
3
|
import { MariaDbDriver } from './MariaDbDriver';
|
|
3
|
-
import type { SqlEntityManager } from '@mikro-orm/knex';
|
|
4
4
|
/**
|
|
5
5
|
* @inheritDoc
|
|
6
6
|
*/
|
package/MariaDbPlatform.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { MySqlPlatform, type TransformContext } from '@mikro-orm/
|
|
1
|
+
import { MySqlPlatform, type TransformContext } from '@mikro-orm/mysql';
|
|
2
2
|
import { MariaDbSchemaHelper } from './MariaDbSchemaHelper';
|
|
3
|
-
import { MariaDbExceptionConverter } from './MariaDbExceptionConverter';
|
|
4
3
|
export declare class MariaDbPlatform extends MySqlPlatform {
|
|
5
4
|
protected readonly schemaHelper: MariaDbSchemaHelper;
|
|
6
|
-
protected readonly exceptionConverter: MariaDbExceptionConverter;
|
|
7
|
-
getDefaultCharset(): string;
|
|
8
5
|
convertJsonToDatabaseValue(value: unknown, context?: TransformContext): unknown;
|
|
6
|
+
convertsJsonAutomatically(): boolean;
|
|
9
7
|
}
|
package/MariaDbPlatform.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MariaDbPlatform = void 0;
|
|
4
|
-
const
|
|
4
|
+
const mysql_1 = require("@mikro-orm/mysql");
|
|
5
5
|
const MariaDbSchemaHelper_1 = require("./MariaDbSchemaHelper");
|
|
6
|
-
|
|
7
|
-
class MariaDbPlatform extends knex_1.MySqlPlatform {
|
|
6
|
+
class MariaDbPlatform extends mysql_1.MySqlPlatform {
|
|
8
7
|
schemaHelper = new MariaDbSchemaHelper_1.MariaDbSchemaHelper(this);
|
|
9
|
-
exceptionConverter = new MariaDbExceptionConverter_1.MariaDbExceptionConverter();
|
|
10
|
-
getDefaultCharset() {
|
|
11
|
-
return 'utf8mb4';
|
|
12
|
-
}
|
|
13
8
|
convertJsonToDatabaseValue(value, context) {
|
|
9
|
+
if (context?.mode === 'hydration') {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
14
12
|
return JSON.stringify(value);
|
|
15
13
|
}
|
|
14
|
+
convertsJsonAutomatically() {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
16
17
|
}
|
|
17
18
|
exports.MariaDbPlatform = MariaDbPlatform;
|
package/MariaDbQueryBuilder.d.ts
CHANGED
package/MariaDbQueryBuilder.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MariaDbQueryBuilder = void 0;
|
|
4
4
|
const core_1 = require("@mikro-orm/core");
|
|
5
|
-
const
|
|
5
|
+
const mysql_1 = require("@mikro-orm/mysql");
|
|
6
6
|
/**
|
|
7
7
|
* @inheritDoc
|
|
8
8
|
*/
|
|
9
|
-
class MariaDbQueryBuilder extends
|
|
9
|
+
class MariaDbQueryBuilder extends mysql_1.QueryBuilder {
|
|
10
10
|
wrapPaginateSubQuery(meta) {
|
|
11
11
|
const pks = this.prepareFields(meta.primaryKeys, 'sub-query');
|
|
12
12
|
const quotedPKs = pks.map(pk => this.platform.quoteIdentifier(pk));
|
|
@@ -35,7 +35,7 @@ class MariaDbQueryBuilder extends knex_1.QueryBuilder {
|
|
|
35
35
|
if (!prop?.persist && !prop?.formula && !pks.includes(fieldName)) {
|
|
36
36
|
addToSelect.push(fieldName);
|
|
37
37
|
}
|
|
38
|
-
const key = (0, core_1.raw)(`min(${this.
|
|
38
|
+
const key = (0, core_1.raw)(`min(${this.platform.quoteIdentifier(fieldName)}${type})`);
|
|
39
39
|
orderBy.push({ [key]: direction });
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -43,7 +43,7 @@ class MariaDbQueryBuilder extends knex_1.QueryBuilder {
|
|
|
43
43
|
}
|
|
44
44
|
// @ts-ignore
|
|
45
45
|
subQuery.finalized = true;
|
|
46
|
-
const
|
|
46
|
+
const innerQuery = subQuery.as(this.mainAlias.aliasName).clear('select').select(pks);
|
|
47
47
|
/* istanbul ignore next */
|
|
48
48
|
if (addToSelect.length > 0) {
|
|
49
49
|
addToSelect.forEach(prop => {
|
|
@@ -58,17 +58,17 @@ class MariaDbQueryBuilder extends knex_1.QueryBuilder {
|
|
|
58
58
|
return false;
|
|
59
59
|
});
|
|
60
60
|
if (field instanceof core_1.RawQueryFragment) {
|
|
61
|
-
|
|
61
|
+
innerQuery.select(this.platform.formatQuery(field.sql, field.params));
|
|
62
62
|
}
|
|
63
63
|
else if (field) {
|
|
64
|
-
|
|
64
|
+
innerQuery.select(field);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
// multiple sub-queries are needed to get around mysql limitations with order by + limit + where in + group by (o.O)
|
|
69
69
|
// https://stackoverflow.com/questions/17892762/mysql-this-version-of-mysql-doesnt-yet-support-limit-in-all-any-some-subqu
|
|
70
|
-
const subSubQuery = this.
|
|
71
|
-
subSubQuery.
|
|
70
|
+
const subSubQuery = this.platform.createNativeQueryBuilder();
|
|
71
|
+
subSubQuery.select((0, core_1.raw)(`json_arrayagg(${quotedPKs.join(', ')})`)).from(innerQuery);
|
|
72
72
|
this._limit = undefined;
|
|
73
73
|
this._offset = undefined;
|
|
74
74
|
// remove joins that are not used for population or ordering to improve performance
|
package/MariaDbSchemaHelper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AbstractSqlConnection, type CheckDef, type Column, type IndexDef, type DatabaseSchema, type Table, MySqlSchemaHelper } from '@mikro-orm/
|
|
1
|
+
import { type AbstractSqlConnection, type CheckDef, type Column, type IndexDef, type DatabaseSchema, type Table, MySqlSchemaHelper } from '@mikro-orm/mysql';
|
|
2
2
|
import { type Dictionary, type Type } from '@mikro-orm/core';
|
|
3
3
|
export declare class MariaDbSchemaHelper extends MySqlSchemaHelper {
|
|
4
4
|
loadInformationSchema(schema: DatabaseSchema, connection: AbstractSqlConnection, tables: Table[]): Promise<void>;
|
|
@@ -6,6 +6,5 @@ export declare class MariaDbSchemaHelper extends MySqlSchemaHelper {
|
|
|
6
6
|
getAllColumns(connection: AbstractSqlConnection, tables: Table[]): Promise<Dictionary<Column[]>>;
|
|
7
7
|
getAllChecks(connection: AbstractSqlConnection, tables: Table[], columns?: Dictionary<Column[]>): Promise<Dictionary<CheckDef[]>>;
|
|
8
8
|
protected getChecksSQL(tables: Table[]): string;
|
|
9
|
-
getChecks(connection: AbstractSqlConnection, tableName: string, schemaName: string, columns?: Column[]): Promise<CheckDef[]>;
|
|
10
9
|
protected wrap(val: string | undefined | null, type: Type<unknown>): string | undefined | null;
|
|
11
10
|
}
|
package/MariaDbSchemaHelper.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MariaDbSchemaHelper = void 0;
|
|
4
|
-
const
|
|
5
|
-
class MariaDbSchemaHelper extends
|
|
4
|
+
const mysql_1 = require("@mikro-orm/mysql");
|
|
5
|
+
class MariaDbSchemaHelper extends mysql_1.MySqlSchemaHelper {
|
|
6
6
|
async loadInformationSchema(schema, connection, tables) {
|
|
7
7
|
/* istanbul ignore next */
|
|
8
8
|
if (tables.length === 0) {
|
|
@@ -128,11 +128,6 @@ class MariaDbSchemaHelper extends knex_1.MySqlSchemaHelper {
|
|
|
128
128
|
where tc.table_name in (${tables.map(t => this.platform.quoteValue(t.table_name))}) and tc.constraint_schema = database()
|
|
129
129
|
order by tc.constraint_name`;
|
|
130
130
|
}
|
|
131
|
-
/* istanbul ignore next */
|
|
132
|
-
async getChecks(connection, tableName, schemaName, columns) {
|
|
133
|
-
const res = await this.getAllChecks(connection, [{ table_name: tableName, schema_name: schemaName }], { [tableName]: columns });
|
|
134
|
-
return res[tableName];
|
|
135
|
-
}
|
|
136
131
|
wrap(val, type) {
|
|
137
132
|
return val;
|
|
138
133
|
}
|
package/README.md
CHANGED
|
@@ -183,7 +183,6 @@ yarn add @mikro-orm/core @mikro-orm/mariadb # for mysql/mariadb
|
|
|
183
183
|
yarn add @mikro-orm/core @mikro-orm/postgresql # for postgresql
|
|
184
184
|
yarn add @mikro-orm/core @mikro-orm/mssql # for mssql
|
|
185
185
|
yarn add @mikro-orm/core @mikro-orm/sqlite # for sqlite
|
|
186
|
-
yarn add @mikro-orm/core @mikro-orm/better-sqlite # for better-sqlite
|
|
187
186
|
yarn add @mikro-orm/core @mikro-orm/libsql # for libsql
|
|
188
187
|
```
|
|
189
188
|
|
|
@@ -196,7 +195,6 @@ npm i -s @mikro-orm/core @mikro-orm/mariadb # for mysql/mariadb
|
|
|
196
195
|
npm i -s @mikro-orm/core @mikro-orm/postgresql # for postgresql
|
|
197
196
|
npm i -s @mikro-orm/core @mikro-orm/mssql # for mssql
|
|
198
197
|
npm i -s @mikro-orm/core @mikro-orm/sqlite # for sqlite
|
|
199
|
-
npm i -s @mikro-orm/core @mikro-orm/better-sqlite # for better-sqlite
|
|
200
198
|
npm i -s @mikro-orm/core @mikro-orm/libsql # for libsql
|
|
201
199
|
```
|
|
202
200
|
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export * from '@mikro-orm/
|
|
2
|
-
export * from './MariaDbConnection';
|
|
1
|
+
export * from '@mikro-orm/mysql';
|
|
3
2
|
export * from './MariaDbSchemaHelper';
|
|
4
3
|
export * from './MariaDbPlatform';
|
|
5
4
|
export * from './MariaDbDriver';
|
|
6
|
-
export * from './MariaDbExceptionConverter';
|
|
7
5
|
export { MariaDbMikroORM as MikroORM, MariaDbOptions as Options, defineMariaDbConfig as defineConfig, } from './MariaDbMikroORM';
|
package/index.js
CHANGED
|
@@ -16,12 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.defineConfig = exports.MikroORM = void 0;
|
|
18
18
|
/* istanbul ignore file */
|
|
19
|
-
__exportStar(require("@mikro-orm/
|
|
20
|
-
__exportStar(require("./MariaDbConnection"), exports);
|
|
19
|
+
__exportStar(require("@mikro-orm/mysql"), exports);
|
|
21
20
|
__exportStar(require("./MariaDbSchemaHelper"), exports);
|
|
22
21
|
__exportStar(require("./MariaDbPlatform"), exports);
|
|
23
22
|
__exportStar(require("./MariaDbDriver"), exports);
|
|
24
|
-
__exportStar(require("./MariaDbExceptionConverter"), exports);
|
|
25
23
|
var MariaDbMikroORM_1 = require("./MariaDbMikroORM");
|
|
26
24
|
Object.defineProperty(exports, "MikroORM", { enumerable: true, get: function () { return MariaDbMikroORM_1.MariaDbMikroORM; } });
|
|
27
25
|
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return MariaDbMikroORM_1.defineMariaDbConfig; } });
|
package/index.mjs
CHANGED
|
@@ -19,12 +19,10 @@ export const ArrayType = mod.ArrayType;
|
|
|
19
19
|
export const BaseEntity = mod.BaseEntity;
|
|
20
20
|
export const BaseSqliteConnection = mod.BaseSqliteConnection;
|
|
21
21
|
export const BaseSqlitePlatform = mod.BaseSqlitePlatform;
|
|
22
|
-
export const BaseSqliteSchemaHelper = mod.BaseSqliteSchemaHelper;
|
|
23
22
|
export const BeforeCreate = mod.BeforeCreate;
|
|
24
23
|
export const BeforeDelete = mod.BeforeDelete;
|
|
25
24
|
export const BeforeUpdate = mod.BeforeUpdate;
|
|
26
25
|
export const BeforeUpsert = mod.BeforeUpsert;
|
|
27
|
-
export const BetterSqliteKnexDialect = mod.BetterSqliteKnexDialect;
|
|
28
26
|
export const BigIntType = mod.BigIntType;
|
|
29
27
|
export const BlobType = mod.BlobType;
|
|
30
28
|
export const BooleanType = mod.BooleanType;
|
|
@@ -112,17 +110,13 @@ export const JSON_KEY_OPERATORS = mod.JSON_KEY_OPERATORS;
|
|
|
112
110
|
export const JoinType = mod.JoinType;
|
|
113
111
|
export const JsonProperty = mod.JsonProperty;
|
|
114
112
|
export const JsonType = mod.JsonType;
|
|
115
|
-
export const
|
|
116
|
-
export const LibSqlKnexDialect = mod.LibSqlKnexDialect;
|
|
113
|
+
export const Kysely = mod.Kysely;
|
|
117
114
|
export const LoadStrategy = mod.LoadStrategy;
|
|
118
115
|
export const LockMode = mod.LockMode;
|
|
119
116
|
export const LockWaitTimeoutException = mod.LockWaitTimeoutException;
|
|
120
117
|
export const ManyToMany = mod.ManyToMany;
|
|
121
118
|
export const ManyToOne = mod.ManyToOne;
|
|
122
|
-
export const MariaDbConnection = mod.MariaDbConnection;
|
|
123
119
|
export const MariaDbDriver = mod.MariaDbDriver;
|
|
124
|
-
export const MariaDbExceptionConverter = mod.MariaDbExceptionConverter;
|
|
125
|
-
export const MariaDbKnexDialect = mod.MariaDbKnexDialect;
|
|
126
120
|
export const MariaDbPlatform = mod.MariaDbPlatform;
|
|
127
121
|
export const MariaDbSchemaHelper = mod.MariaDbSchemaHelper;
|
|
128
122
|
export const MediumIntType = mod.MediumIntType;
|
|
@@ -134,13 +128,14 @@ export const MetadataStorage = mod.MetadataStorage;
|
|
|
134
128
|
export const MetadataValidator = mod.MetadataValidator;
|
|
135
129
|
export const MikroORM = mod.MikroORM;
|
|
136
130
|
export const MongoNamingStrategy = mod.MongoNamingStrategy;
|
|
137
|
-
export const
|
|
138
|
-
export const MsSqlKnexDialect = mod.MsSqlKnexDialect;
|
|
131
|
+
export const MsSqlNativeQueryBuilder = mod.MsSqlNativeQueryBuilder;
|
|
139
132
|
export const MySqlConnection = mod.MySqlConnection;
|
|
133
|
+
export const MySqlDriver = mod.MySqlDriver;
|
|
140
134
|
export const MySqlExceptionConverter = mod.MySqlExceptionConverter;
|
|
141
|
-
export const
|
|
135
|
+
export const MySqlNativeQueryBuilder = mod.MySqlNativeQueryBuilder;
|
|
142
136
|
export const MySqlPlatform = mod.MySqlPlatform;
|
|
143
137
|
export const MySqlSchemaHelper = mod.MySqlSchemaHelper;
|
|
138
|
+
export const NativeQueryBuilder = mod.NativeQueryBuilder;
|
|
144
139
|
export const NodeState = mod.NodeState;
|
|
145
140
|
export const NonUniqueFieldNameException = mod.NonUniqueFieldNameException;
|
|
146
141
|
export const NotFoundError = mod.NotFoundError;
|
|
@@ -160,7 +155,7 @@ export const PlainObject = mod.PlainObject;
|
|
|
160
155
|
export const Platform = mod.Platform;
|
|
161
156
|
export const PopulateHint = mod.PopulateHint;
|
|
162
157
|
export const PopulatePath = mod.PopulatePath;
|
|
163
|
-
export const
|
|
158
|
+
export const PostgreSqlNativeQueryBuilder = mod.PostgreSqlNativeQueryBuilder;
|
|
164
159
|
export const PrimaryKey = mod.PrimaryKey;
|
|
165
160
|
export const PrimaryKeyProp = mod.PrimaryKeyProp;
|
|
166
161
|
export const Property = mod.Property;
|
|
@@ -172,6 +167,7 @@ export const QueryOperator = mod.QueryOperator;
|
|
|
172
167
|
export const QueryOrder = mod.QueryOrder;
|
|
173
168
|
export const QueryOrderNumeric = mod.QueryOrderNumeric;
|
|
174
169
|
export const QueryType = mod.QueryType;
|
|
170
|
+
export const Raw = mod.Raw;
|
|
175
171
|
export const RawQueryFragment = mod.RawQueryFragment;
|
|
176
172
|
export const ReadOnlyException = mod.ReadOnlyException;
|
|
177
173
|
export const Ref = mod.Ref;
|
|
@@ -193,8 +189,9 @@ export const SmallIntType = mod.SmallIntType;
|
|
|
193
189
|
export const SqlEntityManager = mod.SqlEntityManager;
|
|
194
190
|
export const SqlEntityRepository = mod.SqlEntityRepository;
|
|
195
191
|
export const SqlSchemaGenerator = mod.SqlSchemaGenerator;
|
|
196
|
-
export const
|
|
197
|
-
export const
|
|
192
|
+
export const SqliteExceptionConverter = mod.SqliteExceptionConverter;
|
|
193
|
+
export const SqliteNativeQueryBuilder = mod.SqliteNativeQueryBuilder;
|
|
194
|
+
export const SqliteSchemaHelper = mod.SqliteSchemaHelper;
|
|
198
195
|
export const StringType = mod.StringType;
|
|
199
196
|
export const SyntaxErrorException = mod.SyntaxErrorException;
|
|
200
197
|
export const TableExistsException = mod.TableExistsException;
|
|
@@ -228,7 +225,7 @@ export const equals = mod.equals;
|
|
|
228
225
|
export const getOnConflictFields = mod.getOnConflictFields;
|
|
229
226
|
export const getOnConflictReturningFields = mod.getOnConflictReturningFields;
|
|
230
227
|
export const helper = mod.helper;
|
|
231
|
-
export const
|
|
228
|
+
export const isRaw = mod.isRaw;
|
|
232
229
|
export const parseJsonSafe = mod.parseJsonSafe;
|
|
233
230
|
export const raw = mod.raw;
|
|
234
231
|
export const ref = mod.ref;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/mariadb",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-dev.0",
|
|
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",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://mikro-orm.io",
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
49
|
+
"node": ">= 22.11.0"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "yarn clean && yarn compile && yarn copy && yarn run -T gen-esm-wrapper index.js index.mjs",
|
|
@@ -58,13 +58,12 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/
|
|
62
|
-
"mariadb": "3.4.0"
|
|
61
|
+
"@mikro-orm/mysql": "7.0.0-dev.0"
|
|
63
62
|
},
|
|
64
63
|
"devDependencies": {
|
|
65
|
-
"@mikro-orm/core": "^6.4.
|
|
64
|
+
"@mikro-orm/core": "^6.4.5"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|
|
68
|
-
"@mikro-orm/core": "
|
|
67
|
+
"@mikro-orm/core": "7.0.0-dev.0"
|
|
69
68
|
}
|
|
70
69
|
}
|
package/MariaDbConnection.d.ts
DELETED
package/MariaDbConnection.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MariaDbConnection = void 0;
|
|
4
|
-
const knex_1 = require("@mikro-orm/knex");
|
|
5
|
-
class MariaDbConnection extends knex_1.MySqlConnection {
|
|
6
|
-
createKnex() {
|
|
7
|
-
this.client = this.createKnexClient(knex_1.MariaDbKnexDialect);
|
|
8
|
-
this.connected = true;
|
|
9
|
-
}
|
|
10
|
-
getConnectionOptions() {
|
|
11
|
-
const ret = super.getConnectionOptions();
|
|
12
|
-
ret.insertIdAsNumber = true;
|
|
13
|
-
ret.checkDuplicate = false;
|
|
14
|
-
return ret;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.MariaDbConnection = MariaDbConnection;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ExceptionConverter, type Dictionary, type DriverException } from '@mikro-orm/core';
|
|
2
|
-
export declare class MariaDbExceptionConverter extends ExceptionConverter {
|
|
3
|
-
/**
|
|
4
|
-
* @link http://dev.mysql.com/doc/refman/5.7/en/error-messages-client.html
|
|
5
|
-
* @link http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html
|
|
6
|
-
* @link https://github.com/doctrine/dbal/blob/master/src/Driver/AbstractMySQLDriver.php
|
|
7
|
-
*/
|
|
8
|
-
convertException(exception: Error & Dictionary): DriverException;
|
|
9
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MariaDbExceptionConverter = void 0;
|
|
4
|
-
const core_1 = require("@mikro-orm/core");
|
|
5
|
-
class MariaDbExceptionConverter extends core_1.ExceptionConverter {
|
|
6
|
-
/* istanbul ignore next */
|
|
7
|
-
/**
|
|
8
|
-
* @link http://dev.mysql.com/doc/refman/5.7/en/error-messages-client.html
|
|
9
|
-
* @link http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html
|
|
10
|
-
* @link https://github.com/doctrine/dbal/blob/master/src/Driver/AbstractMySQLDriver.php
|
|
11
|
-
*/
|
|
12
|
-
convertException(exception) {
|
|
13
|
-
switch (exception.errno) {
|
|
14
|
-
case 1213:
|
|
15
|
-
return new core_1.DeadlockException(exception);
|
|
16
|
-
case 1205:
|
|
17
|
-
return new core_1.LockWaitTimeoutException(exception);
|
|
18
|
-
case 1050:
|
|
19
|
-
return new core_1.TableExistsException(exception);
|
|
20
|
-
case 1051:
|
|
21
|
-
case 1146:
|
|
22
|
-
return new core_1.TableNotFoundException(exception);
|
|
23
|
-
case 1216:
|
|
24
|
-
case 1217:
|
|
25
|
-
case 1451:
|
|
26
|
-
case 1452:
|
|
27
|
-
case 1701:
|
|
28
|
-
return new core_1.ForeignKeyConstraintViolationException(exception);
|
|
29
|
-
case 4025:
|
|
30
|
-
return new core_1.CheckConstraintViolationException(exception);
|
|
31
|
-
case 1062:
|
|
32
|
-
case 1557:
|
|
33
|
-
case 1569:
|
|
34
|
-
case 1586:
|
|
35
|
-
return new core_1.UniqueConstraintViolationException(exception);
|
|
36
|
-
case 1054:
|
|
37
|
-
case 1166:
|
|
38
|
-
case 1611:
|
|
39
|
-
return new core_1.InvalidFieldNameException(exception);
|
|
40
|
-
case 1052:
|
|
41
|
-
case 1060:
|
|
42
|
-
case 1110:
|
|
43
|
-
return new core_1.NonUniqueFieldNameException(exception);
|
|
44
|
-
case 1064:
|
|
45
|
-
case 1149:
|
|
46
|
-
case 1287:
|
|
47
|
-
case 1341:
|
|
48
|
-
case 1342:
|
|
49
|
-
case 1343:
|
|
50
|
-
case 1344:
|
|
51
|
-
case 1382:
|
|
52
|
-
case 1479:
|
|
53
|
-
case 1541:
|
|
54
|
-
case 1554:
|
|
55
|
-
case 1626:
|
|
56
|
-
return new core_1.SyntaxErrorException(exception);
|
|
57
|
-
case 1044:
|
|
58
|
-
case 1045:
|
|
59
|
-
case 1046:
|
|
60
|
-
case 1049:
|
|
61
|
-
case 1095:
|
|
62
|
-
case 1142:
|
|
63
|
-
case 1143:
|
|
64
|
-
case 1227:
|
|
65
|
-
case 1370:
|
|
66
|
-
case 1429:
|
|
67
|
-
case 2002:
|
|
68
|
-
case 2005:
|
|
69
|
-
return new core_1.ConnectionException(exception);
|
|
70
|
-
case 1048:
|
|
71
|
-
case 1121:
|
|
72
|
-
case 1138:
|
|
73
|
-
case 1171:
|
|
74
|
-
case 1252:
|
|
75
|
-
case 1263:
|
|
76
|
-
case 1364:
|
|
77
|
-
case 1566:
|
|
78
|
-
return new core_1.NotNullConstraintViolationException(exception);
|
|
79
|
-
}
|
|
80
|
-
return super.convertException(exception);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.MariaDbExceptionConverter = MariaDbExceptionConverter;
|