pub enum Backend {
Sqlite(SqliteAdapter),
Postgres(PostgresAdapter),
PgBouncer(PgBouncerAdapter),
Mysql(MySqlAdapter),
}Expand description
Cloning a backend is cheap: adapters share their connection pool.
Variants§
Implementations§
Source§impl Backend
impl Backend
pub async fn begin_transaction(&self) -> Result<TransactionExecutor>
Sourcepub fn sql_compiler(&self) -> &dyn DinocoSqlCompiler
pub fn sql_compiler(&self) -> &dyn DinocoSqlCompiler
The SQL compiler of this backend’s database.
pub fn set_logger(&mut self, enabled: bool)
pub fn logger_enabled(&self) -> bool
pub async fn query<M>(&self, query: FindQuery) -> Result<Vec<M>>where
M: DinocoRowModel,
pub async fn query_relation_join_optional<M>(
&self,
query: RelationJoinQuery,
params: &[DinocoValue],
) -> Result<Vec<M>>where
M: DinocoRowModel,
pub async fn query_relation_batch<M>(
&self,
query: RelationBatchQuery,
) -> Result<Vec<M>>where
M: DinocoRowModel,
pub async fn query_many_to_many_relation<M>(
&self,
query: ManyToManyRelationQuery,
params: &[DinocoValue],
) -> Result<Vec<M>>where
M: DinocoRowModel,
pub async fn insert(&self, query: InsertQuery) -> Result<usize>
pub async fn insert_returning<M>(&self, query: InsertQuery) -> Result<Vec<M>>where
M: DinocoRowModel,
pub async fn update(&self, query: UpdateQuery) -> Result<usize>
pub async fn update_returning<M>(&self, query: UpdateQuery) -> Result<Vec<M>>where
M: DinocoRowModel,
Sourcepub async fn atomic_update_returning<M>(
&self,
query: UpdateQuery,
) -> Result<Vec<M>>where
M: DinocoRowModel,
pub async fn atomic_update_returning<M>(
&self,
query: UpdateQuery,
) -> Result<Vec<M>>where
M: DinocoRowModel,
Executes the mutation before any MySQL compatibility read. This keeps arithmetic and WHERE predicates in one atomic UPDATE statement.
pub async fn delete(&self, query: DeleteQuery) -> Result<usize>
pub async fn delete_returning<M>(&self, query: DeleteQuery) -> Result<Vec<M>>where
M: DinocoRowModel,
pub async fn count(&self, query: CountQuery) -> Result<i64>
pub async fn exists(&self, query: ExistsQuery) -> Result<bool>
pub async fn find_batch(&self, query: FindBatchQuery) -> Result<Vec<Vec<Value>>>
pub async fn count_relation(&self, query: RelationCountQuery) -> Result<i64>
pub async fn count_many_to_many_relation( &self, query: ManyToManyRelationCountQuery, ) -> Result<i64>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Backend
impl !UnwindSafe for Backend
impl Freeze for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl UnsafeUnpin for Backend
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