pub trait SqlTemplate<'q, DB>: Sizedwhere
DB: Database,{
// Required method
fn render_sql_with_encode_placeholder_fn(
self,
f: Option<fn(usize, &mut String)>,
sql_buffer: &mut String,
) -> Result<Option<DB::Arguments<'q>>, Error>;
// Provided methods
fn render_sql(self) -> Result<(String, Option<DB::Arguments<'q>>), Error> { ... }
fn render_execute_able(
self,
sql_buffer: &'q mut String,
) -> Result<SqlTemplateExecute<'q, DB>, Error> { ... }
fn render_db_adapter_manager(
self,
sql_buff: &'q mut String,
) -> DBAdapterManager<'q, DB, Self> { ... }
}Expand description
SQL template trait
Defines basic operations for rendering SQL from templates
Required Methods§
fn render_sql_with_encode_placeholder_fn( self, f: Option<fn(usize, &mut String)>, sql_buffer: &mut String, ) -> Result<Option<DB::Arguments<'q>>, Error>
Provided Methods§
Sourcefn render_sql(self) -> Result<(String, Option<DB::Arguments<'q>>), Error>
fn render_sql(self) -> Result<(String, Option<DB::Arguments<'q>>), Error>
Renders SQL template and returns query string with parameters
Sourcefn render_execute_able(
self,
sql_buffer: &'q mut String,
) -> Result<SqlTemplateExecute<'q, DB>, Error>
fn render_execute_able( self, sql_buffer: &'q mut String, ) -> Result<SqlTemplateExecute<'q, DB>, Error>
Renders SQL template and returns executable query result
fn render_db_adapter_manager( self, sql_buff: &'q mut String, ) -> DBAdapterManager<'q, DB, Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.