pub trait TransactionExt {
// Required method
fn query_cursor<'a>(
&'a self,
query: &str,
batch_size: usize,
) -> impl Future<Output = Result<CursorStream<'a>, Error>> + Send
where Self: 'a;
}Expand description
Extension trait for
Transaction
to add cursor support.
Required Methods§
Sourcefn query_cursor<'a>(
&'a self,
query: &str,
batch_size: usize,
) -> impl Future<Output = Result<CursorStream<'a>, Error>> + Sendwhere
Self: 'a,
fn query_cursor<'a>(
&'a self,
query: &str,
batch_size: usize,
) -> impl Future<Output = Result<CursorStream<'a>, Error>> + Sendwhere
Self: 'a,
Method to create a new CursorStream for the given query.
Parameters:
query: The SQL query for which the cursor will be declared.batch_size: The number of rows to fetch in each batch.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<'t> TransactionExt for Transaction<'t>
Implementation of TransactionExt for
Transaction
impl<'t> TransactionExt for Transaction<'t>
Implementation of TransactionExt for
Transaction
Source§async fn query_cursor<'a>(
&'a self,
query: &str,
batch_size: usize,
) -> Result<CursorStream<'a>, Error>where
Self: 'a,
async fn query_cursor<'a>(
&'a self,
query: &str,
batch_size: usize,
) -> Result<CursorStream<'a>, Error>where
Self: 'a,
Method to create a new CursorStream for the given query.
Parameters:
query: The SQL query for which the cursor will be declared.batch_size: The number of rows to fetch in each batch.
Errors:
- Propagates
tokio_postgres::Errorif the cursor declaration fails