Add flag to disable sql auto pipelining (#21067)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2025-07-15 01:13:35 -07:00
committed by GitHub
parent e62f9286c9
commit 89aae0bdc0
4 changed files with 9 additions and 2 deletions

View File

@@ -934,6 +934,11 @@ pub fn hasQueryRunning(this: *PostgresSQLConnection) bool {
}
pub fn canPipeline(this: *PostgresSQLConnection) bool {
if (bun.getRuntimeFeatureFlag(.BUN_FEATURE_FLAG_DISABLE_SQL_AUTO_PIPELINING)) {
@branchHint(.unlikely);
return false;
}
return this.nonpipelinable_requests == 0 and // need to wait for non pipelinable requests to finish
!this.flags.use_unnamed_prepared_statements and // unnamed statements are not pipelinable
!this.flags.waiting_to_prepare and // cannot pipeline when waiting prepare