@mikro-orm/core 7.1.5-dev.1 → 7.1.5-dev.11
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "7.1.5-dev.
|
|
3
|
+
"version": "7.1.5-dev.11",
|
|
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",
|
|
@@ -35,5 +35,7 @@ export declare abstract class AbstractSchemaGenerator<D extends IDatabaseDriver>
|
|
|
35
35
|
execute(query: string): Promise<void>;
|
|
36
36
|
ensureIndexes(): Promise<void>;
|
|
37
37
|
protected getOrderedMetadata(schema?: string, includeWildcardSchema?: boolean): EntityMetadata[];
|
|
38
|
+
/** View entities are not backed by real tables, so they must be skipped when truncating/deleting during `clear()`. */
|
|
39
|
+
protected getOrderedMetadataForClear(schema?: string): EntityMetadata[];
|
|
38
40
|
protected notImplemented(): never;
|
|
39
41
|
}
|
|
@@ -39,7 +39,7 @@ export class AbstractSchemaGenerator {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
async clear(options) {
|
|
42
|
-
for (const meta of this.
|
|
42
|
+
for (const meta of this.getOrderedMetadataForClear(options?.schema).reverse()) {
|
|
43
43
|
await this.driver.nativeDelete(meta.class, {}, options);
|
|
44
44
|
}
|
|
45
45
|
if (options?.clearIdentityMap ?? true) {
|
|
@@ -123,6 +123,10 @@ export class AbstractSchemaGenerator {
|
|
|
123
123
|
return schema ? [schema, '*'].includes(targetSchema) : meta.schema !== '*';
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
+
/** View entities are not backed by real tables, so they must be skipped when truncating/deleting during `clear()`. */
|
|
127
|
+
getOrderedMetadataForClear(schema) {
|
|
128
|
+
return this.getOrderedMetadata(schema).filter(meta => !meta.view);
|
|
129
|
+
}
|
|
126
130
|
notImplemented() {
|
|
127
131
|
throw new Error(`This method is not supported by ${this.driver.constructor.name} driver`);
|
|
128
132
|
}
|
package/utils/Utils.js
CHANGED
|
@@ -141,7 +141,7 @@ export function parseJsonSafe(value) {
|
|
|
141
141
|
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
142
142
|
export class Utils {
|
|
143
143
|
static PK_SEPARATOR = '~~~';
|
|
144
|
-
static #ORM_VERSION = '7.1.5-dev.
|
|
144
|
+
static #ORM_VERSION = '7.1.5-dev.11';
|
|
145
145
|
/**
|
|
146
146
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
147
147
|
*/
|