Struct fire_postgres::database::Database
source · pub struct Database { /* private fields */ }
Implementations§
source§impl Database
impl Database
sourcepub async fn new(
name: impl Into<String>,
user: impl Into<String>,
password: impl Into<String>
) -> Result<Self, DatabaseError>
pub async fn new( name: impl Into<String>, user: impl Into<String>, password: impl Into<String> ) -> Result<Self, DatabaseError>
Create a new database
sourcepub async fn with_host(
host: impl Into<String>,
name: impl Into<String>,
user: impl Into<String>,
password: impl Into<String>
) -> Result<Self, DatabaseError>
pub async fn with_host( host: impl Into<String>, name: impl Into<String>, user: impl Into<String>, password: impl Into<String> ) -> Result<Self, DatabaseError>
Create a new database with a host
pub async fn with_cfg(cfg: Config) -> Result<Self, DatabaseError>
pub async fn get(&self) -> Result<ConnectionOwned, DatabaseError>
pub fn migrations(&self) -> Migrations
sourcepub fn table_owned<T>(&self, name: &'static str) -> TableOwned<T>where
T: TableTemplate,
pub fn table_owned<T>(&self, name: &'static str) -> TableOwned<T>where
T: TableTemplate,
Get a table from the database
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
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