pub trait Backend:
Send
+ Sync
+ DynClone {
// Required methods
fn name(&self) -> &'static str;
fn row_id_column(&self) -> Option<&'static str>;
fn create_migration_sql(
&self,
current: &ADB,
ops: Vec<Operation>,
) -> Result<String>;
fn connect(&self, conn_str: &str) -> Result<Connection>;
}Expand description
Database backend. A boxed implementation can be returned by name via get_backend.
Required Methods§
Sourcefn row_id_column(&self) -> Option<&'static str>
fn row_id_column(&self) -> Option<&'static str>
Backend-dependent field name for the database’s internal identifier for each row.
It may be used to sort the rows in the order they were inserted,
however consult the backend documentation for the exact behavior.
For example, SQLite uses rowid and PostgreSQL uses ctid.
This is not the same as the primary key of the table.
It may be None if the backend does not support this.
fn create_migration_sql( &self, current: &ADB, ops: Vec<Operation>, ) -> Result<String>
Sourcefn connect(&self, conn_str: &str) -> Result<Connection>
fn connect(&self, conn_str: &str) -> Result<Connection>
Establish a new sync connection.
The format of the connection string is backend-dependent.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".