@mikro-orm/knex 6.3.11-dev.1 → 6.3.11-dev.10
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
|
@@ -912,15 +912,12 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
912
912
|
getFieldsForJoinedLoad(qb, meta, explicitFields, exclude, populate = [], options, parentTableAlias, parentJoinPath) {
|
|
913
913
|
const fields = [];
|
|
914
914
|
const joinedProps = this.joinedProps(meta, populate, options);
|
|
915
|
-
if (explicitFields?.includes('*')) {
|
|
916
|
-
fields.push('*');
|
|
917
|
-
}
|
|
918
915
|
const shouldHaveColumn = (prop, populate, fields) => {
|
|
919
916
|
if (!this.platform.shouldHaveColumn(prop, populate, exclude)) {
|
|
920
917
|
return false;
|
|
921
918
|
}
|
|
922
|
-
if (!fields || prop.primary) {
|
|
923
|
-
return
|
|
919
|
+
if (!fields || fields.includes('*') || prop.primary) {
|
|
920
|
+
return true;
|
|
924
921
|
}
|
|
925
922
|
return fields.some(f => f === prop.name || f.toString().startsWith(prop.name + '.'));
|
|
926
923
|
};
|
package/AbstractSqlPlatform.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare abstract class AbstractSqlPlatform extends Platform {
|
|
|
11
11
|
lookupExtensions(orm: MikroORM): void;
|
|
12
12
|
getSchemaGenerator(driver: IDatabaseDriver, em?: EntityManager): SqlSchemaGenerator;
|
|
13
13
|
quoteValue(value: any): string;
|
|
14
|
+
escape(value: any): string;
|
|
14
15
|
getSearchJsonPropertySQL(path: string, type: string, aliased: boolean): string;
|
|
15
16
|
getSearchJsonPropertyKey(path: string[], type: string, aliased: boolean, value?: unknown): string;
|
|
16
17
|
getJsonIndexDefinition(index: IndexDef): string[];
|
package/AbstractSqlPlatform.js
CHANGED
|
@@ -34,11 +34,12 @@ class AbstractSqlPlatform extends core_1.Platform {
|
|
|
34
34
|
if (this.isRaw(value)) {
|
|
35
35
|
return value;
|
|
36
36
|
}
|
|
37
|
-
/* istanbul ignore if */
|
|
38
37
|
if (core_1.Utils.isPlainObject(value) || value?.[core_1.JsonProperty]) {
|
|
39
|
-
return
|
|
38
|
+
return this.escape(JSON.stringify(value));
|
|
40
39
|
}
|
|
41
|
-
|
|
40
|
+
return this.escape(value);
|
|
41
|
+
}
|
|
42
|
+
escape(value) {
|
|
42
43
|
return (0, sqlstring_1.escape)(value, true, this.timezone);
|
|
43
44
|
}
|
|
44
45
|
getSearchJsonPropertySQL(path, type, aliased) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type EntityProperty } from '@mikro-orm/core';
|
|
1
2
|
import { AbstractSqlPlatform } from '../../AbstractSqlPlatform';
|
|
2
3
|
export declare abstract class BaseSqlitePlatform extends AbstractSqlPlatform {
|
|
3
4
|
usesDefaultKeyword(): boolean;
|
|
@@ -53,4 +54,6 @@ export declare abstract class BaseSqlitePlatform extends AbstractSqlPlatform {
|
|
|
53
54
|
getDefaultPrimaryName(tableName: string, columns: string[]): string;
|
|
54
55
|
supportsDownMigrations(): boolean;
|
|
55
56
|
getFullTextWhereClause(): string;
|
|
57
|
+
quoteVersionValue(value: Date | number, prop: EntityProperty): Date | string | number;
|
|
58
|
+
quoteValue(value: any): string;
|
|
56
59
|
}
|
|
@@ -81,5 +81,17 @@ class BaseSqlitePlatform extends AbstractSqlPlatform_1.AbstractSqlPlatform {
|
|
|
81
81
|
getFullTextWhereClause() {
|
|
82
82
|
return `:column: match :query`;
|
|
83
83
|
}
|
|
84
|
+
quoteVersionValue(value, prop) {
|
|
85
|
+
if (prop.runtimeType === 'Date') {
|
|
86
|
+
return this.escape(value).replace(/^'|\.\d{3}'$/g, '');
|
|
87
|
+
}
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
quoteValue(value) {
|
|
91
|
+
if (value instanceof Date) {
|
|
92
|
+
return '' + +value;
|
|
93
|
+
}
|
|
94
|
+
return super.quoteValue(value);
|
|
95
|
+
}
|
|
84
96
|
}
|
|
85
97
|
exports.BaseSqlitePlatform = BaseSqlitePlatform;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.3.11-dev.
|
|
3
|
+
"version": "6.3.11-dev.10",
|
|
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,7 +66,7 @@
|
|
|
66
66
|
"@mikro-orm/core": "^6.3.10"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.3.11-dev.
|
|
69
|
+
"@mikro-orm/core": "6.3.11-dev.10",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|