diff --git a/sqlx-core/src/raw_sql.rs b/sqlx-core/src/raw_sql.rs index 37627d4453..b64eeec0e4 100644 --- a/sqlx-core/src/raw_sql.rs +++ b/sqlx-core/src/raw_sql.rs @@ -139,26 +139,26 @@ impl<'q, DB: Database> Execute<'q, DB> for RawSql<'q> { impl<'q> RawSql<'q> { /// Execute the SQL string and return the total number of rows affected. #[inline] - pub async fn execute<'e, E>( + pub async fn execute<'e, 'c: 'e, E>( self, executor: E, ) -> crate::Result<::QueryResult> where 'q: 'e, - E: Executor<'e>, + E: Executor<'c>, { executor.execute(self).await } /// Execute the SQL string. Returns a stream which gives the number of rows affected for each statement in the string. #[inline] - pub fn execute_many<'e, E>( + pub fn execute_many<'e, 'c: 'e, E>( self, executor: E, ) -> BoxStream<'e, crate::Result<::QueryResult>> where 'q: 'e, - E: Executor<'e>, + E: Executor<'c>, { executor.execute_many(self) } @@ -167,13 +167,13 @@ impl<'q> RawSql<'q> { /// /// If the string contains multiple statements, their results will be concatenated together. #[inline] - pub fn fetch<'e, E>( + pub fn fetch<'e, 'c: 'e, E>( self, executor: E, ) -> BoxStream<'e, Result<::Row, Error>> where 'q: 'e, - E: Executor<'e>, + E: Executor<'c>, { executor.fetch(self) } @@ -183,7 +183,7 @@ impl<'q> RawSql<'q> { /// For each query in the stream, any generated rows are returned first, /// then the `QueryResult` with the number of rows affected. #[inline] - pub fn fetch_many<'e, E>( + pub fn fetch_many<'e, 'c: 'e, E>( self, executor: E, ) -> BoxStream< @@ -195,7 +195,7 @@ impl<'q> RawSql<'q> { > where 'q: 'e, - E: Executor<'e>, + E: Executor<'c>, { executor.fetch_many(self) } @@ -208,7 +208,7 @@ impl<'q> RawSql<'q> { /// To avoid exhausting available memory, ensure the result set has a known upper bound, /// e.g. using `LIMIT`. #[inline] - pub async fn fetch_all<'e, E>( + pub async fn fetch_all<'e, 'c: 'e, E>( self, executor: E, ) -> crate::Result::Row>> @@ -232,13 +232,13 @@ impl<'q> RawSql<'q> { /// /// Otherwise, you might want to add `LIMIT 1` to your query. #[inline] - pub async fn fetch_one<'e, E>( + pub async fn fetch_one<'e, 'c: 'e, E>( self, executor: E, ) -> crate::Result<::Row> where 'q: 'e, - E: Executor<'e>, + E: Executor<'c>, { executor.fetch_one(self).await } @@ -256,13 +256,13 @@ impl<'q> RawSql<'q> { /// /// Otherwise, you might want to add `LIMIT 1` to your query. #[inline] - pub async fn fetch_optional<'e, E>( + pub async fn fetch_optional<'e, 'c: 'e, E>( self, executor: E, ) -> crate::Result<::Row> where 'q: 'e, - E: Executor<'e>, + E: Executor<'c>, { executor.fetch_one(self).await }