@mikro-orm/knex 6.3.11-dev.7 → 6.3.11-dev.9
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/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.9",
|
|
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.9",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|