@mikro-orm/sql 7.1.0-dev.5 → 7.1.0-dev.6
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/AbstractSqlDriver.js
CHANGED
|
@@ -34,6 +34,13 @@ export class AbstractSqlDriver extends DatabaseDriver {
|
|
|
34
34
|
return { alias, name: meta.tableName, schema: effectiveSchema, qualifiedName, toString: () => alias };
|
|
35
35
|
}
|
|
36
36
|
validateSqlOptions(options) {
|
|
37
|
+
if (options.using && !options.indexHint) {
|
|
38
|
+
const names = Utils.asArray(options.using);
|
|
39
|
+
const hint = this.platform.formatIndexHint(names);
|
|
40
|
+
if (hint) {
|
|
41
|
+
options.indexHint = hint;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
37
44
|
if (options.collation != null && typeof options.collation !== 'string') {
|
|
38
45
|
throw new Error('Collation option for SQL drivers must be a string (collation name). Use a CollationOptions object only with MongoDB.');
|
|
39
46
|
}
|
|
@@ -17,6 +17,7 @@ export declare class BaseMySqlPlatform extends AbstractSqlPlatform {
|
|
|
17
17
|
supportsMultiColumnCountDistinct(): boolean;
|
|
18
18
|
/** @internal */
|
|
19
19
|
createNativeQueryBuilder(): MySqlNativeQueryBuilder;
|
|
20
|
+
formatIndexHint(indexNames: string[]): string;
|
|
20
21
|
getDefaultCharset(): string;
|
|
21
22
|
init(orm: MikroORM): void;
|
|
22
23
|
getBeginTransactionSQL(options?: {
|
|
@@ -25,6 +25,9 @@ export class BaseMySqlPlatform extends AbstractSqlPlatform {
|
|
|
25
25
|
createNativeQueryBuilder() {
|
|
26
26
|
return new MySqlNativeQueryBuilder(this);
|
|
27
27
|
}
|
|
28
|
+
formatIndexHint(indexNames) {
|
|
29
|
+
return `use index(${indexNames.join(', ')})`;
|
|
30
|
+
}
|
|
28
31
|
getDefaultCharset() {
|
|
29
32
|
return 'utf8mb4';
|
|
30
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/sql",
|
|
3
|
-
"version": "7.1.0-dev.
|
|
3
|
+
"version": "7.1.0-dev.6",
|
|
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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@mikro-orm/core": "^7.0.11"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.1.0-dev.
|
|
56
|
+
"@mikro-orm/core": "7.1.0-dev.6"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|