Struct tusk_rs::database::DatabaseConnection
source · pub struct DatabaseConnection { /* private fields */ }
Implementations§
source§impl DatabaseConnection
impl DatabaseConnection
pub async fn query<T: AsRef<str>>( &self, query: T, args: &[&(dyn ToSql + Sync)] ) -> Result<Vec<Row>, Error>
pub async fn select_all<T: FromPostgres + PostgresReadable + PostgresTable>( &self, query: &str, args: &[&(dyn ToSql + Sync)] ) -> Result<Vec<T>, PostgresReadError>
pub async fn select_one<T: FromPostgres + PostgresReadable + PostgresTable>( &self, query: &str, args: &[&(dyn ToSql + Sync)] ) -> Result<T, PostgresReadError>
pub async fn insert<T: FromPostgres + PostgresTable + PostgresReadFields>( &self, write: PostgresWrite ) -> Result<T, PostgresWriteError>
pub async fn insert_vec<T: FromPostgres + PostgresTable + PostgresReadable>( &self, write: PostgresWrite ) -> Result<Vec<T>, PostgresWriteError>
pub async fn update<T: FromPostgres + PostgresTable + PostgresReadable + Debug>( &self, write: PostgresWrite, condition: &str, args: &[&(dyn ToSql + Sync)] ) -> Result<T, PostgresWriteError>
pub async fn update_set<T: FromPostgres + PostgresTable + PostgresReadable>( &self, query: &str, args: &[&(dyn ToSql + Sync)] ) -> Result<T, PostgresWriteError>
pub async fn delete<T: PostgresTable>( &self, condition: &str, args: &[&(dyn ToSql + Sync)] )
Auto Trait Implementations§
impl Freeze for DatabaseConnection
impl !RefUnwindSafe for DatabaseConnection
impl Send for DatabaseConnection
impl Sync for DatabaseConnection
impl Unpin for DatabaseConnection
impl !UnwindSafe for DatabaseConnection
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