pub struct SqlTemplateGenerator { /* private fields */ }Expand description
SQL template generator.
Implementations§
Source§impl SqlTemplateGenerator
impl SqlTemplateGenerator
Sourcepub fn new(target: DatabaseTarget) -> Self
pub fn new(target: DatabaseTarget) -> Self
Create new SQL template generator.
Sourcepub fn generate(&self, ir: &AuthoringIR) -> Result<Vec<SqlTemplate>>
pub fn generate(&self, ir: &AuthoringIR) -> Result<Vec<SqlTemplate>>
Sourcepub const fn target(&self) -> DatabaseTarget
pub const fn target(&self) -> DatabaseTarget
Get database target.
Sourcepub fn expand_template(
&self,
template: &SqlTemplate,
params: &HashMap<String, Value>,
where_clause: Option<&str>,
order_by: Option<&str>,
limit: Option<u64>,
offset: Option<u64>,
) -> String
pub fn expand_template( &self, template: &SqlTemplate, params: &HashMap<String, Value>, where_clause: Option<&str>, order_by: Option<&str>, limit: Option<u64>, offset: Option<u64>, ) -> String
Expand a template with actual parameter values.
This method replaces template placeholders with actual values:
{param}-> actual parameter value{where_clause}-> WHERE clause or empty{order_by}-> ORDER BY clause or empty{pagination}-> LIMIT/OFFSET or empty
Auto Trait Implementations§
impl Freeze for SqlTemplateGenerator
impl RefUnwindSafe for SqlTemplateGenerator
impl Send for SqlTemplateGenerator
impl Sync for SqlTemplateGenerator
impl Unpin for SqlTemplateGenerator
impl UnsafeUnpin for SqlTemplateGenerator
impl UnwindSafe for SqlTemplateGenerator
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