Skip to content

Commit

Permalink
fix(core): respect context in virtual entity expression callback
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Dec 15, 2023
1 parent 6a5a1ef commit 84d42a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/knex/src/AbstractSqlDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export abstract class AbstractSqlDriver<Connection extends AbstractSqlConnection
return this.wrapVirtualExpressionInSubquery(meta, meta.expression, where, options as FindOptions<T, any>, type);
}

const em = this.createEntityManager(false);
const em = this.createEntityManager();
em.setTransactionContext(options.ctx);
const res = meta.expression(em, where, options as FindOptions<T, any>);

Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb/src/MongoDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class MongoDriver extends DatabaseDriver<MongoConnection> {
const meta = this.metadata.find(entityName)!;

if (meta.expression instanceof Function) {
const em = this.createEntityManager<MongoDriver>(false);
const em = this.createEntityManager<MongoDriver>();
return meta.expression(em, where, options) as EntityData<T>[];
}

Expand Down

0 comments on commit 84d42a7

Please sign in to comment.