pub struct PreparedStatementCache { /* private fields */ }Expand description
A cache for prepared statements.
This cache stores prepared statements by their SQL query string, allowing reuse of statements across multiple queries.
Implementations§
Source§impl PreparedStatementCache
impl PreparedStatementCache
Sourcepub async fn get_or_prepare(
&self,
client: &Object,
sql: &str,
) -> PgResult<Statement>
pub async fn get_or_prepare( &self, client: &Object, sql: &str, ) -> PgResult<Statement>
Get or prepare a statement for the given SQL.
Sourcepub async fn get_or_prepare_in_txn<'a>(
&self,
txn: &Transaction<'a>,
sql: &str,
) -> PgResult<Statement>
pub async fn get_or_prepare_in_txn<'a>( &self, txn: &Transaction<'a>, sql: &str, ) -> PgResult<Statement>
Get or prepare a statement within a transaction.
Auto Trait Implementations§
impl !Freeze for PreparedStatementCache
impl RefUnwindSafe for PreparedStatementCache
impl Send for PreparedStatementCache
impl Sync for PreparedStatementCache
impl Unpin for PreparedStatementCache
impl UnsafeUnpin for PreparedStatementCache
impl UnwindSafe for PreparedStatementCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more