pub struct PostgresBackend { /* private fields */ }
Expand description
A PostgreSQL database backend using tokio-postgres
Trait Implementations§
Source§impl Clone for PostgresBackend
impl Clone for PostgresBackend
Source§fn clone(&self) -> PostgresBackend
fn clone(&self) -> PostgresBackend
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl DatabaseBackend for PostgresBackend
impl DatabaseBackend for PostgresBackend
Source§fn create_pool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 DatabaseName,
_config: &'life2 DatabaseConfig,
) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_pool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 DatabaseName,
_config: &'life2 DatabaseConfig,
) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new connection pool for the given database
Source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a single connection to the given database This is useful for cases where a full pool is not needed
Source§fn connect_with_string<'life0, 'life1, 'async_trait>(
&'life0 self,
connection_string: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect_with_string<'life0, 'life1, 'async_trait>(
&'life0 self,
connection_string: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a single connection using a connection string directly
type Connection = PostgresConnection
type Pool = PostgresPool
type Error = PostgresError
fn new<'async_trait>(
config: DatabaseConfig,
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Source§fn create_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_pool: &'life1 Self::Pool,
name: &'life2 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_pool: &'life1 Self::Pool,
name: &'life2 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new database with the given name
Source§fn drop_database(&self, name: &DatabaseName) -> Result<(), Self::Error>
fn drop_database(&self, name: &DatabaseName) -> Result<(), Self::Error>
Drop a database with the given name
Source§fn connection_string(&self, name: &DatabaseName) -> String
fn connection_string(&self, name: &DatabaseName) -> String
Get the connection string for the given database
Auto Trait Implementations§
impl Freeze for PostgresBackend
impl RefUnwindSafe for PostgresBackend
impl Send for PostgresBackend
impl Sync for PostgresBackend
impl Unpin for PostgresBackend
impl UnwindSafe for PostgresBackend
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