Struct tokio_postgres::Transaction[][src]

pub struct Transaction<'a> { /* fields omitted */ }
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

Performs the conversion.

Performs the conversion.

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.