pub trait Query: Expression {
// Required methods
fn query_type(&self) -> QueryType;
fn dialect(&self) -> &dyn Dialect;
// Provided methods
fn build(&self) -> Result<(String, Vec<Value>)> { ... }
fn build_from(&self, start: usize) -> Result<(String, Vec<Value>)> { ... }
}Expand description
A complete, runnable statement.
An Expression is any fragment; a Query is a fragment that stands alone,
knows which dialect it is written in and therefore can be built without being
told anything. That is what lets q.build() take no arguments while a bare
expression still needs build(dialect, expr).
A query is also an expression, so it nests as a sub-select — and because the
placeholder counter belongs to the SqlWriter rather than
to the query, nesting re-indexes on its own.
Required Methods§
Sourcefn query_type(&self) -> QueryType
fn query_type(&self) -> QueryType
Which statement this renders.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".