@@ -140,10 +140,7 @@ impl<'q, DB: Database> Execute<'q, DB> for RawSql<'q> {
140
140
impl < ' q > RawSql < ' q > {
141
141
/// Execute the SQL string and return the total number of rows affected.
142
142
#[ inline]
143
- pub async fn execute < ' e , E , DB > (
144
- self ,
145
- executor : E ,
146
- ) -> crate :: Result < DB :: QueryResult >
143
+ pub async fn execute < ' e , E , DB > ( self , executor : E ) -> crate :: Result < DB :: QueryResult >
147
144
where
148
145
' q : ' e ,
149
146
DB : Database ,
@@ -170,10 +167,7 @@ impl<'q> RawSql<'q> {
170
167
///
171
168
/// If the string contains multiple statements, their results will be concatenated together.
172
169
#[ inline]
173
- pub fn fetch < ' e , E , DB > (
174
- self ,
175
- executor : E ,
176
- ) -> BoxStream < ' e , Result < DB :: Row , Error > >
170
+ pub fn fetch < ' e , E , DB > ( self , executor : E ) -> BoxStream < ' e , Result < DB :: Row , Error > >
177
171
where
178
172
' q : ' e ,
179
173
DB : Database ,
@@ -190,13 +184,7 @@ impl<'q> RawSql<'q> {
190
184
pub fn fetch_many < ' e , E , DB > (
191
185
self ,
192
186
executor : E ,
193
- ) -> BoxStream <
194
- ' e ,
195
- Result <
196
- Either < DB :: QueryResult , DB :: Row > ,
197
- Error ,
198
- > ,
199
- >
187
+ ) -> BoxStream < ' e , Result < Either < DB :: QueryResult , DB :: Row > , Error > >
200
188
where
201
189
' q : ' e ,
202
190
DB : Database ,
@@ -213,10 +201,7 @@ impl<'q> RawSql<'q> {
213
201
/// To avoid exhausting available memory, ensure the result set has a known upper bound,
214
202
/// e.g. using `LIMIT`.
215
203
#[ inline]
216
- pub fn fetch_all < ' e , E , DB > (
217
- self ,
218
- executor : E ,
219
- ) -> BoxFuture < ' e , crate :: Result < Vec < DB :: Row > > >
204
+ pub fn fetch_all < ' e , E , DB > ( self , executor : E ) -> BoxFuture < ' e , crate :: Result < Vec < DB :: Row > > >
220
205
where
221
206
' q : ' e ,
222
207
DB : Database ,
@@ -238,10 +223,7 @@ impl<'q> RawSql<'q> {
238
223
///
239
224
/// Otherwise, you might want to add `LIMIT 1` to your query.
240
225
#[ inline]
241
- pub fn fetch_one < ' e , E , DB > (
242
- self ,
243
- executor : E ,
244
- ) -> BoxFuture < ' e , crate :: Result < DB :: Row > >
226
+ pub fn fetch_one < ' e , E , DB > ( self , executor : E ) -> BoxFuture < ' e , crate :: Result < DB :: Row > >
245
227
where
246
228
' q : ' e ,
247
229
DB : Database ,
@@ -263,10 +245,7 @@ impl<'q> RawSql<'q> {
263
245
///
264
246
/// Otherwise, you might want to add `LIMIT 1` to your query.
265
247
#[ inline]
266
- pub async fn fetch_optional < ' e , E , DB > (
267
- self ,
268
- executor : E ,
269
- ) -> crate :: Result < DB :: Row >
248
+ pub async fn fetch_optional < ' e , E , DB > ( self , executor : E ) -> crate :: Result < DB :: Row >
270
249
where
271
250
' q : ' e ,
272
251
DB : Database ,
@@ -275,25 +254,3 @@ impl<'q> RawSql<'q> {
275
254
executor. fetch_one ( self ) . await
276
255
}
277
256
}
278
-
279
- #[ cfg( test) ]
280
- mod tests {
281
- use sqlx:: { Connection , SqliteConnection } ;
282
-
283
- #[ test]
284
- fn issue_3150 ( ) {
285
- tokio:: runtime:: Builder :: new_current_thread ( )
286
- . enable_all ( )
287
- . build ( )
288
- . unwrap ( )
289
- . block_on ( async {
290
- tokio:: spawn ( async {
291
- let mut db = SqliteConnection :: connect ( ":memory:" ) . await . unwrap ( ) ;
292
- sqlx:: raw_sql ( "" ) . execute ( & mut db) . await . unwrap ( ) ;
293
- db. close ( ) . await . unwrap ( ) ;
294
- } )
295
- . await
296
- } )
297
- . ok ( ) ;
298
- }
299
- }
0 commit comments