Trait bison_orm::builder::BuilderExt[][src]

pub trait BuilderExt {
    fn quote(&self, ident: impl Into<String>) -> String;
fn schema(&mut self, schema: impl AsRef<str>) -> &mut Self;
fn ident(&mut self, s: impl AsRef<str>) -> &mut Self;
fn ident_comma<I, S>(&mut self, s: I) -> &mut Self
    where
        I: IntoIterator<Item = S>,
        S: AsRef<str>
;
fn op(&mut self, op: Op) -> &mut Self;
fn arg(&mut self, arg: impl ToString) -> &mut Self;
fn join(&mut self, builder: impl Builder) -> &mut Self;
fn join_many<I, B>(&mut self, builders: I) -> &mut Self
    where
        I: IntoIterator<Item = B>,
        B: Builder
;
fn nested(&mut self, f: impl FnOnce(&mut BaseBuilder)) -> &mut Self;
fn push_str(&mut self, s: impl AsRef<str>) -> &mut Self;
fn push(&mut self, c: char) -> &mut Self;
fn prefix(&mut self, s: impl AsRef<str>) -> &mut Self;
fn comma(&mut self) -> &mut Self;
fn pad(&mut self) -> &mut Self;
fn is_ident(&self, s: impl AsRef<str>) -> bool;
fn dialect(&self) -> &Dialect;
fn set_dialect(&mut self, dialect: Dialect) -> &mut Self;
fn total(&self) -> usize;
fn set_total(&mut self, total: usize) -> &mut Self; }

An extension trait for query builders that provides a variety of convenient functions.

Required methods

fn quote(&self, ident: impl Into<String>) -> String[src]

Quotes the given identifier with the characters based on the configured dialect. It defaults to "`".

fn schema(&mut self, schema: impl AsRef<str>) -> &mut Self[src]

fn ident(&mut self, s: impl AsRef<str>) -> &mut Self[src]

Appends the given string as an identifier.

fn ident_comma<I, S>(&mut self, s: I) -> &mut Self where
    I: IntoIterator<Item = S>,
    S: AsRef<str>, 
[src]

Calls ident on all arguments and adds a comma between them.

fn op(&mut self, op: Op) -> &mut Self[src]

Push an operator to the builder.

fn arg(&mut self, arg: impl ToString) -> &mut Self[src]

Append an input argument to the builder.

fn join(&mut self, builder: impl Builder) -> &mut Self[src]

Join this builder with an existing builder.

fn join_many<I, B>(&mut self, builders: I) -> &mut Self where
    I: IntoIterator<Item = B>,
    B: Builder
[src]

Join this builder with a list of comma seperated builders.

fn nested(&mut self, f: impl FnOnce(&mut BaseBuilder)) -> &mut Self[src]

Accepts a callback, and wraps its result with parentheses.

fn push_str(&mut self, s: impl AsRef<str>) -> &mut Self[src]

Push a raw string to the builder.

fn push(&mut self, c: char) -> &mut Self[src]

Push a raw char to the builder.

fn prefix(&mut self, s: impl AsRef<str>) -> &mut Self[src]

Prefix the builder query with a raw string.

fn comma(&mut self) -> &mut Self[src]

Add a comma to the query.

fn pad(&mut self) -> &mut Self[src]

Add a space to the query.

fn is_ident(&self, s: impl AsRef<str>) -> bool[src]

Whether the given string is a dialect identifier.

fn dialect(&self) -> &Dialect[src]

Returns the dialect of the builder.

fn set_dialect(&mut self, dialect: Dialect) -> &mut Self[src]

Sets the builder dialect. It's used for garnering dialect specific queries.

fn total(&self) -> usize[src]

Returns the total number of arguments so far.

fn set_total(&mut self, total: usize) -> &mut Self[src]

Sets the value of the total arguments. Used to pass this information between sub builders/expressions.

Loading content...

Implementors

impl BuilderExt for BaseBuilder[src]

impl<T> BuilderExt for T where
    T: ChildBuilder, 
[src]

Loading content...