pub struct PostgresConnection { /* private fields */ }Expand description
PostgreSQL connection.
Trait Implementations§
Source§impl Connection for PostgresConnection
impl Connection for PostgresConnection
Source§async fn connect(
driver: &PostgresDriver,
url: Cow<'static, str>,
) -> Result<Self>
async fn connect( driver: &PostgresDriver, url: Cow<'static, str>, ) -> Result<Self>
Establishes a connection (or pool) to the database specified by the URL. Read more
Source§fn begin(&mut self) -> impl Future<Output = Result<PostgresTransaction<'_>>>
fn begin(&mut self) -> impl Future<Output = Result<PostgresTransaction<'_>>>
Starts a new transaction on this connection. Read more
Source§async fn disconnect(self) -> Result<()>
async fn disconnect(self) -> Result<()>
Closes the connection and releases any session resources.
Source§impl Debug for PostgresConnection
impl Debug for PostgresConnection
Source§impl Executor for PostgresConnection
impl Executor for PostgresConnection
Source§type Driver = PostgresDriver
type Driver = PostgresDriver
Associated driver.
Source§async fn do_prepare(&mut self, sql: String) -> Result<Query<PostgresDriver>>
async fn do_prepare(&mut self, sql: String) -> Result<Query<PostgresDriver>>
Internal hook for implementing prepared statement support.
Source§fn run<'s>(
&'s mut self,
query: impl AsQuery<PostgresDriver> + 's,
) -> impl Stream<Item = Result<QueryResult>> + Send
fn run<'s>( &'s mut self, query: impl AsQuery<PostgresDriver> + 's, ) -> impl Stream<Item = Result<QueryResult>> + Send
Executes a query and streams the results (rows or affected counts).
Source§fn fetch<'s>(
&'s mut self,
query: impl AsQuery<PostgresDriver> + 's,
) -> impl Stream<Item = Result<Row>> + Send
fn fetch<'s>( &'s mut self, query: impl AsQuery<PostgresDriver> + 's, ) -> impl Stream<Item = Result<Row>> + Send
Executes a query and streams the resulting rows, ignoring affected counts.
Source§async fn append<'a, E, It>(&mut self, entities: It) -> Result<RowsAffected>
async fn append<'a, E, It>(&mut self, entities: It) -> Result<RowsAffected>
Efficiently inserts a collection of entities bypassing regular SQL execution when supported by the driver.
Source§fn accepts_multiple_statements(&self) -> bool
fn accepts_multiple_statements(&self) -> bool
Checks if the driver supports multiple SQL statements in a single request.
Source§fn driver(&self) -> Self::Driverwhere
Self: Sized,
fn driver(&self) -> Self::Driverwhere
Self: Sized,
Returns the driver instance associated with this executor.
Auto Trait Implementations§
impl Freeze for PostgresConnection
impl !RefUnwindSafe for PostgresConnection
impl Send for PostgresConnection
impl Sync for PostgresConnection
impl Unpin for PostgresConnection
impl UnsafeUnpin for PostgresConnection
impl !UnwindSafe for PostgresConnection
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