@mikro-orm/knex 6.0.0-dev.223 → 6.0.0-dev.225
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
|
@@ -111,7 +111,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
111
111
|
if (typeof meta.expression === 'string') {
|
|
112
112
|
return this.wrapVirtualExpressionInSubquery(meta, meta.expression, where, options, type);
|
|
113
113
|
}
|
|
114
|
-
const em = this.createEntityManager(
|
|
114
|
+
const em = this.createEntityManager();
|
|
115
115
|
em.setTransactionContext(options.ctx);
|
|
116
116
|
const res = meta.expression(em, where, options);
|
|
117
117
|
if (typeof res === 'string') {
|
package/AbstractSqlPlatform.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare abstract class AbstractSqlPlatform extends Platform {
|
|
|
13
13
|
quoteValue(value: any): string;
|
|
14
14
|
formatQuery(sql: string, params: readonly any[]): string;
|
|
15
15
|
getSearchJsonPropertySQL(path: string, type: string, aliased: boolean): string;
|
|
16
|
-
getSearchJsonPropertyKey(path: string[], type: string, aliased: boolean): string;
|
|
16
|
+
getSearchJsonPropertyKey(path: string[], type: string, aliased: boolean, value?: unknown): string;
|
|
17
17
|
getJsonIndexDefinition(index: IndexDef): string[];
|
|
18
18
|
isRaw(value: any): boolean;
|
|
19
19
|
supportsSchemas(): boolean;
|
package/AbstractSqlPlatform.js
CHANGED
|
@@ -83,7 +83,7 @@ class AbstractSqlPlatform extends core_1.Platform {
|
|
|
83
83
|
getSearchJsonPropertySQL(path, type, aliased) {
|
|
84
84
|
return this.getSearchJsonPropertyKey(path.split('->'), type, aliased);
|
|
85
85
|
}
|
|
86
|
-
getSearchJsonPropertyKey(path, type, aliased) {
|
|
86
|
+
getSearchJsonPropertyKey(path, type, aliased, value) {
|
|
87
87
|
const [a, ...b] = path;
|
|
88
88
|
const quoteKey = (key) => key.match(/^[a-z]\w*$/i) ? key : `"${key}"`;
|
|
89
89
|
if (aliased) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.0.0-dev.
|
|
3
|
+
"version": "6.0.0-dev.225",
|
|
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",
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"@mikro-orm/core": "^5.9.2"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.0.0-dev.
|
|
69
|
+
"@mikro-orm/core": "6.0.0-dev.225"
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -21,6 +21,12 @@ class ScalarCriteriaNode extends CriteriaNode_1.CriteriaNode {
|
|
|
21
21
|
qb.addSelect(field);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
if (this.payload && typeof this.payload === 'object') {
|
|
25
|
+
const keys = Object.keys(this.payload).filter(key => core_1.Utils.isArrayOperator(key) && Array.isArray(this.payload[key]));
|
|
26
|
+
for (const key of keys) {
|
|
27
|
+
this.payload[key] = JSON.stringify(this.payload[key]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
24
30
|
return this.payload;
|
|
25
31
|
}
|
|
26
32
|
willAutoJoin(qb, alias) {
|