Struct deadpool_postgres::Transaction [−][src]
pub struct Transaction<'a> { /* fields omitted */ }
Expand description
Wrapper around tokio_postgres::Transaction
with a StatementCache
from the Client
object it was created by.
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.
Like tokio_postgres::Transaction::transaction()
, but returns a
wrapped Transaction
with a StatementCache
.
Like tokio_postgres::Transaction::savepoint()
, but returns a wrapped
Transaction
with a StatementCache
.
Methods from Deref<Target = PgTransaction<'a>>
Like Client::prepare
.
Like Client::prepare_typed
.
Like Client::query
.
Like Client::query_one
.
Like Client::query_opt
.
pub async fn query_raw<T, P, I>(
&'_ self,
statement: &'_ T,
params: I
) -> Result<RowStream, Error> where
T: ToStatement + ?Sized,
P: BorrowToSql,
I: IntoIterator<Item = P>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
pub async fn query_raw<T, P, I>(
&'_ self,
statement: &'_ T,
params: I
) -> Result<RowStream, Error> where
T: ToStatement + ?Sized,
P: BorrowToSql,
I: IntoIterator<Item = P>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
Like Client::query_raw
.
Like Client::execute
.
pub async fn execute_raw<P, I, T>(
&'_ self,
statement: &'_ T,
params: I
) -> Result<u64, Error> where
T: ToStatement + ?Sized,
P: BorrowToSql,
I: IntoIterator<Item = P>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
pub async fn execute_raw<P, I, T>(
&'_ self,
statement: &'_ T,
params: I
) -> Result<u64, Error> where
T: ToStatement + ?Sized,
P: BorrowToSql,
I: IntoIterator<Item = P>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
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.
pub async fn bind_raw<P, T, I>(
&'_ self,
statement: &'_ T,
params: I
) -> Result<Portal, Error> where
T: ToStatement + ?Sized,
P: BorrowToSql,
I: IntoIterator<Item = P>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
pub async fn bind_raw<P, T, I>(
&'_ self,
statement: &'_ T,
params: I
) -> Result<Portal, Error> where
T: ToStatement + ?Sized,
P: BorrowToSql,
I: IntoIterator<Item = P>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
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
.
pub async fn copy_in<T, U>(
&'_ self,
statement: &'_ T
) -> Result<CopyInSink<U>, Error> where
T: ToStatement + ?Sized,
U: 'static + Buf + Send,
pub async fn copy_in<T, U>(
&'_ self,
statement: &'_ T
) -> Result<CopyInSink<U>, Error> where
T: ToStatement + ?Sized,
U: 'static + Buf + Send,
Like Client::copy_in
.
pub async fn copy_out<T>(
&'_ self,
statement: &'_ T
) -> Result<CopyOutStream, Error> where
T: ToStatement + ?Sized,
pub async fn copy_out<T>(
&'_ self,
statement: &'_ T
) -> Result<CopyOutStream, Error> where
T: ToStatement + ?Sized,
Like Client::copy_out
.
pub async fn simple_query(
&'_ self,
query: &'_ str
) -> Result<Vec<SimpleQueryMessage, Global>, Error>
pub async fn simple_query(
&'_ self,
query: &'_ str
) -> Result<Vec<SimpleQueryMessage, Global>, Error>
Like Client::simple_query
.
Like Client::batch_execute
.
Like Client::cancel_token
.
pub async fn cancel_query<T>(&'_ self, tls: T) -> Result<(), Error> where
T: MakeTlsConnect<Socket>,
👎 Deprecated since 0.6.0: use Transaction::cancel_token() instead
pub async fn cancel_query<T>(&'_ self, tls: T) -> Result<(), Error> where
T: MakeTlsConnect<Socket>,
use Transaction::cancel_token() instead
Like Client::cancel_query
.
pub async fn cancel_query_raw<S, T>(
&'_ self,
stream: S,
tls: T
) -> Result<(), Error> where
S: AsyncRead + AsyncWrite + Unpin,
T: TlsConnect<S>,
👎 Deprecated since 0.6.0: use Transaction::cancel_token() instead
pub async fn cancel_query_raw<S, T>(
&'_ self,
stream: S,
tls: T
) -> Result<(), Error> where
S: AsyncRead + AsyncWrite + Unpin,
T: TlsConnect<S>,
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.
Trait Implementations
type Target = PgTransaction<'a>
type Target = PgTransaction<'a>
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.