Created
January 18, 2018 14:14
-
-
Save shssoichiro/d09a2e3a23489208253fe36cad9a00bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl<C: Connection> Connection for LoggingConnection<C> | |
where | |
C: Connection<TransactionManager = AnsiTransactionManager> + Send + 'static, | |
C::Backend: UsesAnsiSavepointSyntax, | |
{ | |
type Backend = C::Backend; | |
fn query_by_index<T, U>(&self, source: T) -> QueryResult<Vec<U>> | |
where | |
T: AsQuery, | |
T::Query: QueryFragment<Self::Backend> + QueryId, | |
U: Queryable<T::SqlType, Self::Backend>, | |
Self::Backend: HasSqlType<T::SqlType>, | |
Self::Backend::QueryBuilder: Default, | |
{ | |
let start_time = Instant::now(); | |
let result = self.0.query_by_index(source); | |
let duration = start_time.elapsed(); | |
log_query(&debug_query::<Self::Backend, _>(&source.as_query()).to_string(), duration); | |
result | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment