pub struct Transaction<'a> {
    pub statement_cache: Arc<StatementCache>,
    /* private fields */
}
Expand description

Wrapper around tokio_postgres::Transaction with a StatementCache from the Client object it was created by.

Fields

statement_cache: Arc<StatementCache>

Implementations

Like tokio_postgres::Transaction::prepare(), but uses an existing Statement from the StatementCache if possible.

Like tokio_postgres::Transaction::prepare_typed(), but uses an existing Statement from the StatementCache if possible.

Methods from Deref<Target = PgTransaction<'a>>

Like Client::prepare.

Like Client::prepare_typed.

Like Client::query.

Like Client::query_one.

Like Client::query_opt.

Like Client::query_raw.

Like Client::execute.

Like Client::execute_iter.

Binds a statement to a set of parameters, creating a Portal which can be incrementally queried.

Portals only last for the duration of the transaction in which they are created, and can only be used on the connection that created them.

Panics

Panics if the number of parameters provided does not match the number expected.

A maximally flexible version of bind.

Continues execution of a portal, returning a stream of the resulting rows.

Unlike query, portals can be incrementally evaluated by limiting the number of rows returned in each call to query_portal. If the requested number is negative or 0, all rows will be returned.

The maximally flexible version of query_portal.

Like Client::copy_in.

Like Client::copy_out.

Like Client::simple_query.

Like Client::batch_execute.

Like Client::cancel_token.

👎Deprecated since 0.6.0: use Transaction::cancel_token() instead

Like Client::cancel_query.

👎Deprecated since 0.6.0: use Transaction::cancel_token() instead

Like Client::cancel_query_raw.

Like Client::transaction, but creates a nested transaction via a savepoint.

Like Client::transaction, but creates a nested transaction via a savepoint with the specified name.

Returns a reference to the underlying Client.

Trait Implementations

Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more