pub struct Transaction<'a> { /* private fields */ }
Expand description

A representation of a PostgreSQL database transaction.

Transactions will implicitly roll back when dropped. Use the commit method to commit the changes made in the transaction. Transactions can be nested, with inner transactions implemented via safepoints.

Implementations

Consumes the transaction, committing all changes made within it.

Rolls the transaction back, discarding all changes made within it.

This is equivalent to Transaction’s Drop implementation, but provides any error encountered to the caller.

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

Executes the destructor for this type. Read more

Like Client::execute.

Like Client::execute_raw.

Like Client::query.

Like Client::query_one.

Like Client::query_opt.

Like Client::query_raw.

Like Client::prepare.

Like Client::prepare_typed.

Like Client::transaction.

Returns a reference to the underlying Client.

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