File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
sqlx-postgres/src/connection Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -412,6 +412,15 @@ WHERE rngtypid = $1
412412 Ok ( array_oid)
413413 }
414414
415+ /// Check whether EXPLAIN statements are supported by the current connection
416+ fn is_explain_available ( & self ) -> bool {
417+ let parameter_statuses = & self . inner . stream . parameter_statuses ;
418+ let is_cockroachdb = parameter_statuses. contains_key ( "crdb_version" ) ;
419+ let is_materialize = parameter_statuses. contains_key ( "mz_version" ) ;
420+ let is_questdb = parameter_statuses. contains_key ( "questdb_version" ) ;
421+ !is_cockroachdb && !is_materialize && !is_questdb
422+ }
423+
415424 pub ( crate ) async fn get_nullable_for_columns (
416425 & mut self ,
417426 stmt_id : StatementId ,
@@ -487,11 +496,7 @@ WHERE rngtypid = $1
487496 } ) ?;
488497
489498 // If the server doesn't support EXPLAIN statements, skip this step (#1248).
490- let parameter_statuses = & self . inner . stream . parameter_statuses ;
491- let is_cockroachdb = parameter_statuses. contains_key ( "crdb_version" ) ;
492- let is_materialize = parameter_statuses. contains_key ( "mz_version" ) ;
493- let is_questdb = parameter_statuses. contains_key ( "questdb_version" ) ;
494- if !is_cockroachdb && !is_materialize && !is_questdb {
499+ if self . is_explain_available ( ) {
495500 // patch up our null inference with data from EXPLAIN
496501 let nullable_patch = self
497502 . nullables_from_explain ( stmt_id, meta. parameters . len ( ) )
You can’t perform that action at this time.
0 commit comments