Skip to content

Commit

Permalink
fix(core): respect transaction context in em.execute()
Browse files Browse the repository at this point in the history
Closes #3896
  • Loading branch information
B4nan committed Jan 4, 2023
1 parent 807aa47 commit 832105d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/knex/src/SqlEntityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class SqlEntityManager<D extends AbstractSqlDriver = AbstractSqlDriver> e
}

async execute<T extends QueryResult | EntityData<AnyEntity> | EntityData<AnyEntity>[] = EntityData<AnyEntity>[]>(queryOrKnex: string | Knex.QueryBuilder | Knex.Raw, params: any[] = [], method: 'all' | 'get' | 'run' = 'all'): Promise<T> {
return this.getDriver().execute(queryOrKnex, params, method, this.getTransactionContext());
return this.getDriver().execute(queryOrKnex, params, method, this.getContext().getTransactionContext());
}

getRepository<T extends object, U extends EntityRepository<T> = SqlEntityRepository<T>>(entityName: EntityName<T>): GetRepository<T, U> {
Expand Down

0 comments on commit 832105d

Please sign in to comment.