Struct diesel_logger::LoggingConnection [] [src]

pub struct LoggingConnection<C: Connection>(_);

Wraps a diesel Connection to time and log each query using the configured logger for the log crate.

Currently, this produces a debug log on every query, an info on queries that take longer than 1 second, and a warning on queries that take longer than 5 seconds. These thresholds will be configurable in a future version.

Methods

impl<C: Connection> LoggingConnection<C>
[src]

[src]

Trait Implementations

impl<C: Connection> Deref for LoggingConnection<C>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<C> SimpleConnection for LoggingConnection<C> where
    C: Connection + Send + 'static, 
[src]

[src]

Execute multiple SQL statements within the same string. Read more

impl<C: Connection> Connection for LoggingConnection<C> where
    C: Connection<TransactionManager = AnsiTransactionManager> + Send + 'static,
    C::Backend: UsesAnsiSavepointSyntax,
    <C::Backend as Backend>::QueryBuilder: Default
[src]

The backend this type connects to

[src]

Establishes a new connection to the database Read more

[src]

[src]

[src]

[src]

[src]

[src]

Executes the given function inside of a database transaction Read more

[src]

Creates a transaction that will never be committed. This is useful for tests. Panics if called while inside of a transaction. Read more

[src]

Executes the given function inside a transaction, but does not commit it. Panics if the given function returns an error. Read more