Skip to content

Instantly share code, notes, and snippets.

@shssoichiro shssoichiro/lib.rs
Created Jan 18, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.