diff --git a/sqlx-core/src/executor.rs b/sqlx-core/src/executor.rs index b487f7d9..634f78cb 100644 --- a/sqlx-core/src/executor.rs +++ b/sqlx-core/src/executor.rs @@ -28,6 +28,10 @@ where where E: Execute<'q, Self::Database>; + /// Executes a query for its result. + /// + /// Returns a [`Cursor`] that can be used to iterate through the [`Row`]s + /// of the result. fn fetch<'e, 'q, E>(&'e mut self, query: E) -> >::Cursor where E: Execute<'q, Self::Database>; @@ -45,14 +49,12 @@ where E: Execute<'q, Self::Database>; } -pub trait RefExecutor<'c> { +// HACK: Generic Associated Types (GATs) will enable us to rework how the Executor bound is done +// in Query to remove the need for this. +pub trait RefExecutor<'e> { type Database: Database; - /// Executes a query for its result. - /// - /// Returns a [`Cursor`] that can be used to iterate through the [`Row`]s - /// of the result. - fn fetch_by_ref<'q, E>(self, query: E) -> >::Cursor + fn fetch_by_ref<'q, E>(self, query: E) -> >::Cursor where E: Execute<'q, Self::Database>; }