Skip to main content

DialectExt

Trait DialectExt 

Source
pub trait DialectExt {
    // Required method
    fn render_placeholder(&self, index: usize) -> Cow<'static, str>;

    // Provided method
    fn write_placeholder(&self, index: usize, out: &mut String) { ... }
}
Expand description

Extension trait for Dialect-specific placeholder rendering

Required Methods§

Source

fn render_placeholder(&self, index: usize) -> Cow<'static, str>

Renders a placeholder for this dialect with the given 1-based index.

Returns Cow::Borrowed("?") for SQLite/MySQL (zero allocation), Cow::Owned for PostgreSQL numbered placeholders.

§Examples
  • PostgreSQL: $1, $2, $3
  • SQLite/MySQL: ?

Provided Methods§

Source

fn write_placeholder(&self, index: usize, out: &mut String)

Appends a placeholder directly into an output buffer.

Implementors§