Skip to content

Instantly share code, notes, and snippets.

@shssoichiro shssoichiro/
Created Jan 18, 2018

What would you like to do?
impl<C: Connection> Connection for LoggingConnection<C>
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>>
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.