feat: introduce IntoArguments, query_with, query_as_with, and query_scalar_with

This commit is contained in:
Ryan Leckey
2020-05-27 19:53:23 -07:00
parent 88532ffc28
commit 9d2a0141cb
21 changed files with 345 additions and 106 deletions

View File

@@ -74,7 +74,7 @@ fn emplace_row_metadata(
impl<'c> Executor<'c> for &'c mut SqliteConnection {
type Database = Sqlite;
fn fetch_many<'q: 'c, E>(
fn fetch_many<'q: 'c, E: 'c>(
self,
mut query: E,
) -> BoxStream<'c, Result<Either<u64, SqliteRow>, Error>>
@@ -148,7 +148,10 @@ impl<'c> Executor<'c> for &'c mut SqliteConnection {
})
}
fn fetch_optional<'q: 'c, E>(self, query: E) -> BoxFuture<'c, Result<Option<SqliteRow>, Error>>
fn fetch_optional<'q: 'c, E: 'c>(
self,
query: E,
) -> BoxFuture<'c, Result<Option<SqliteRow>, Error>>
where
E: Execute<'q, Self::Database>,
{
@@ -166,7 +169,7 @@ impl<'c> Executor<'c> for &'c mut SqliteConnection {
}
#[doc(hidden)]
fn describe<'q: 'c, E>(self, query: E) -> BoxFuture<'c, Result<Describe<Sqlite>, Error>>
fn describe<'q: 'c, E: 'c>(self, query: E) -> BoxFuture<'c, Result<Describe<Sqlite>, Error>>
where
E: Execute<'q, Self::Database>,
{