pub struct SQLBackend {
pub dialect: SQLDialect,
}Expand description
The SQL code generation backend.
Fields§
§dialect: SQLDialectImplementations§
Source§impl SQLBackend
impl SQLBackend
Sourcepub fn new(dialect: SQLDialect) -> Self
pub fn new(dialect: SQLDialect) -> Self
Create a new SQL backend for the given dialect.
Sourcepub fn create_table_stmt(&self, table: &SQLTable) -> String
pub fn create_table_stmt(&self, table: &SQLTable) -> String
Build a CREATE TABLE statement from a SQLTable.
Sourcepub fn schema_for_type(&self, type_name: &str) -> SQLTable
pub fn schema_for_type(&self, type_name: &str) -> SQLTable
Produce a default table schema for a named OxiLean type.
Sourcepub fn select_all(&self, table: &str) -> String
pub fn select_all(&self, table: &str) -> String
Emit a simple SELECT * from a table.
Sourcepub fn select_limit(&self, table: &str, n: usize) -> String
pub fn select_limit(&self, table: &str, n: usize) -> String
Emit a SELECT with a LIMIT clause.
Sourcepub fn insert_placeholders(&self, table: &str, col_count: usize) -> String
pub fn insert_placeholders(&self, table: &str, col_count: usize) -> String
Emit a parameterised INSERT placeholder list (dialect-aware).
Auto Trait Implementations§
impl Freeze for SQLBackend
impl RefUnwindSafe for SQLBackend
impl Send for SQLBackend
impl Sync for SQLBackend
impl Unpin for SQLBackend
impl UnsafeUnpin for SQLBackend
impl UnwindSafe for SQLBackend
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