@mikro-orm/knex 5.8.11-dev.11 → 5.8.11-dev.13
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.d.ts +0 -1
- package/AbstractSqlDriver.js +1 -12
- package/package.json +4 -4
package/AbstractSqlDriver.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export declare abstract class AbstractSqlDriver<Connection extends AbstractSqlCo
|
|
|
21
21
|
protected wrapVirtualExpressionInSubquery<T extends object>(meta: EntityMetadata<T>, expression: string, where: FilterQuery<T>, options: FindOptions<T, any>, type: QueryType): Promise<T[] | number>;
|
|
22
22
|
mapResult<T extends object>(result: EntityData<T>, meta: EntityMetadata<T>, populate?: PopulateOptions<T>[], qb?: QueryBuilder<T>, map?: Dictionary): EntityData<T> | null;
|
|
23
23
|
private mapJoinedProps;
|
|
24
|
-
private appendToCollection;
|
|
25
24
|
count<T extends object>(entityName: string, where: any, options?: CountOptions<T>): Promise<number>;
|
|
26
25
|
nativeInsert<T extends object>(entityName: string, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
|
|
27
26
|
nativeInsertMany<T extends object>(entityName: string, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
package/AbstractSqlDriver.js
CHANGED
|
@@ -186,7 +186,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
186
186
|
});
|
|
187
187
|
if ([core_1.ReferenceType.MANY_TO_MANY, core_1.ReferenceType.ONE_TO_MANY].includes(relation.reference)) {
|
|
188
188
|
result[relation.name] = result[relation.name] || [];
|
|
189
|
-
|
|
189
|
+
result[relation.name].push(relationPojo);
|
|
190
190
|
}
|
|
191
191
|
else {
|
|
192
192
|
result[relation.name] = relationPojo;
|
|
@@ -195,17 +195,6 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
195
195
|
this.mapJoinedProps(relationPojo, meta2, populateChildren, qb, root, map, path);
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
appendToCollection(meta, collection, relationPojo) {
|
|
199
|
-
if (collection.length === 0) {
|
|
200
|
-
return void collection.push(relationPojo);
|
|
201
|
-
}
|
|
202
|
-
const last = collection[collection.length - 1];
|
|
203
|
-
const pk1 = core_1.Utils.getCompositeKeyHash(last, meta);
|
|
204
|
-
const pk2 = core_1.Utils.getCompositeKeyHash(relationPojo, meta);
|
|
205
|
-
if (pk1 !== pk2) {
|
|
206
|
-
collection.push(relationPojo);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
198
|
async count(entityName, where, options = {}) {
|
|
210
199
|
const meta = this.metadata.find(entityName);
|
|
211
200
|
if (meta?.virtual) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "5.8.11-dev.
|
|
3
|
+
"version": "5.8.11-dev.13",
|
|
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,9 +66,9 @@
|
|
|
66
66
|
"@mikro-orm/core": "^5.8.10"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "5.8.11-dev.
|
|
70
|
-
"@mikro-orm/entity-generator": "5.8.11-dev.
|
|
71
|
-
"@mikro-orm/migrations": "5.8.11-dev.
|
|
69
|
+
"@mikro-orm/core": "5.8.11-dev.13",
|
|
70
|
+
"@mikro-orm/entity-generator": "5.8.11-dev.13",
|
|
71
|
+
"@mikro-orm/migrations": "5.8.11-dev.13",
|
|
72
72
|
"better-sqlite3": "*",
|
|
73
73
|
"mssql": "*",
|
|
74
74
|
"mysql": "*",
|