Skip to content

Commit

Permalink
fix(sql): allow creating query builder from a global context
Browse files Browse the repository at this point in the history
Since it's fine to use `qb.execute()` on a global context, only `qb.getResult()` is problematic.
  • Loading branch information
B4nan committed Mar 13, 2024
1 parent 5b4e7d7 commit 9217bb3
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 @@ -24,7 +24,7 @@ export class SqlEntityManager<Driver extends AbstractSqlDriver = AbstractSqlDriv
* Creates a QueryBuilder instance
*/
createQueryBuilder<T extends object>(entityName: EntityName<T> | QueryBuilder<T>, alias?: string, type?: ConnectionType, loggerContext?: LoggingOptions): QueryBuilder<T> {
const context = this.getContext();
const context = this.getContext(false);
return new QueryBuilder<T>(entityName, this.getMetadata(), this.getDriver(), context.getTransactionContext(), alias, type, context, loggerContext ?? context.loggerContext);
}

Expand Down

0 comments on commit 9217bb3

Please sign in to comment.