Commit 447ac4a 1 parent 0db12a9 commit 447ac4a Copy full SHA for 447ac4a
File tree 5 files changed +18
-8
lines changed
sqlx-core/src/any/connection
5 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,14 @@ pub trait AnyConnectionBackend: std::any::Any + Debug + Send + 'static {
72
72
fn fetch_many < ' q > (
73
73
& ' q mut self ,
74
74
query : & ' q str ,
75
+ persistent : bool ,
75
76
arguments : Option < AnyArguments < ' q > > ,
76
77
) -> BoxStream < ' q , crate :: Result < Either < AnyQueryResult , AnyRow > > > ;
77
78
78
79
fn fetch_optional < ' q > (
79
80
& ' q mut self ,
80
81
query : & ' q str ,
82
+ persistent : bool ,
81
83
arguments : Option < AnyArguments < ' q > > ,
82
84
) -> BoxFuture < ' q , crate :: Result < Option < AnyRow > > > ;
83
85
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ impl<'c> Executor<'c> for &'c mut AnyConnection {
23
23
Ok ( arguments) => arguments,
24
24
Err ( error) => return stream:: once ( future:: ready ( Err ( error) ) ) . boxed ( ) ,
25
25
} ;
26
- self . backend . fetch_many ( query. sql ( ) , arguments)
26
+ self . backend
27
+ . fetch_many ( query. sql ( ) , query. persistent ( ) , arguments)
27
28
}
28
29
29
30
fn fetch_optional < ' e , ' q : ' e , E > (
@@ -38,7 +39,8 @@ impl<'c> Executor<'c> for &'c mut AnyConnection {
38
39
Ok ( arguments) => arguments,
39
40
Err ( error) => return future:: ready ( Err ( error) ) . boxed ( ) ,
40
41
} ;
41
- self . backend . fetch_optional ( query. sql ( ) , arguments)
42
+ self . backend
43
+ . fetch_optional ( query. sql ( ) , query. persistent ( ) , arguments)
42
44
}
43
45
44
46
fn prepare_with < ' e , ' q : ' e > (
Original file line number Diff line number Diff line change @@ -75,9 +75,10 @@ impl AnyConnectionBackend for MySqlConnection {
75
75
fn fetch_many < ' q > (
76
76
& ' q mut self ,
77
77
query : & ' q str ,
78
+ persistent : bool ,
78
79
arguments : Option < AnyArguments < ' q > > ,
79
80
) -> BoxStream < ' q , sqlx_core:: Result < Either < AnyQueryResult , AnyRow > > > {
80
- let persistent = arguments. is_some ( ) ;
81
+ let persistent = persistent && arguments. is_some ( ) ;
81
82
let arguments = match arguments. as_ref ( ) . map ( AnyArguments :: convert_to) . transpose ( ) {
82
83
Ok ( arguments) => arguments,
83
84
Err ( error) => {
@@ -100,9 +101,10 @@ impl AnyConnectionBackend for MySqlConnection {
100
101
fn fetch_optional < ' q > (
101
102
& ' q mut self ,
102
103
query : & ' q str ,
104
+ persistent : bool ,
103
105
arguments : Option < AnyArguments < ' q > > ,
104
106
) -> BoxFuture < ' q , sqlx_core:: Result < Option < AnyRow > > > {
105
- let persistent = arguments. is_some ( ) ;
107
+ let persistent = persistent && arguments. is_some ( ) ;
106
108
let arguments = arguments
107
109
. as_ref ( )
108
110
. map ( AnyArguments :: convert_to)
Original file line number Diff line number Diff line change @@ -74,9 +74,10 @@ impl AnyConnectionBackend for PgConnection {
74
74
fn fetch_many < ' q > (
75
75
& ' q mut self ,
76
76
query : & ' q str ,
77
+ persistent : bool ,
77
78
arguments : Option < AnyArguments < ' q > > ,
78
79
) -> BoxStream < ' q , sqlx_core:: Result < Either < AnyQueryResult , AnyRow > > > {
79
- let persistent = arguments. is_some ( ) ;
80
+ let persistent = persistent && arguments. is_some ( ) ;
80
81
let arguments = match arguments. as_ref ( ) . map ( AnyArguments :: convert_to) . transpose ( ) {
81
82
Ok ( arguments) => arguments,
82
83
Err ( error) => {
@@ -99,9 +100,10 @@ impl AnyConnectionBackend for PgConnection {
99
100
fn fetch_optional < ' q > (
100
101
& ' q mut self ,
101
102
query : & ' q str ,
103
+ persistent : bool ,
102
104
arguments : Option < AnyArguments < ' q > > ,
103
105
) -> BoxFuture < ' q , sqlx_core:: Result < Option < AnyRow > > > {
104
- let persistent = arguments. is_some ( ) ;
106
+ let persistent = persistent && arguments. is_some ( ) ;
105
107
let arguments = arguments
106
108
. as_ref ( )
107
109
. map ( AnyArguments :: convert_to)
Original file line number Diff line number Diff line change @@ -75,9 +75,10 @@ impl AnyConnectionBackend for SqliteConnection {
75
75
fn fetch_many < ' q > (
76
76
& ' q mut self ,
77
77
query : & ' q str ,
78
+ persistent : bool ,
78
79
arguments : Option < AnyArguments < ' q > > ,
79
80
) -> BoxStream < ' q , sqlx_core:: Result < Either < AnyQueryResult , AnyRow > > > {
80
- let persistent = arguments. is_some ( ) ;
81
+ let persistent = persistent && arguments. is_some ( ) ;
81
82
let args = arguments. map ( map_arguments) ;
82
83
83
84
Box :: pin (
@@ -97,9 +98,10 @@ impl AnyConnectionBackend for SqliteConnection {
97
98
fn fetch_optional < ' q > (
98
99
& ' q mut self ,
99
100
query : & ' q str ,
101
+ persistent : bool ,
100
102
arguments : Option < AnyArguments < ' q > > ,
101
103
) -> BoxFuture < ' q , sqlx_core:: Result < Option < AnyRow > > > {
102
- let persistent = arguments. is_some ( ) ;
104
+ let persistent = persistent && arguments. is_some ( ) ;
103
105
let args = arguments. map ( map_arguments) ;
104
106
105
107
Box :: pin ( async move {
You can’t perform that action at this time.
0 commit comments