Skip to main content

Module builder

Module builder 

Source
Expand description

The typed SQLite query builder.

QueryBuilder builds SELECT, INSERT, UPDATE and DELETE statements (with optional common table expressions) and renders them to SQL. The submodules hold each statement’s builder states. The drizzle crate’s drivers wrap this builder to run the queries.

Re-exports§

pub use cte::CTEDefinition;
pub use cte::CTEView;
pub use insert::OnConflictBuilder;

Modules§

cte
Common table expressions (WITH name AS (...)) for SQLite.
delete
The DELETE builder: DeleteBuilder and its states.
insert
The INSERT builder: InsertBuilder, its states, and OnConflictBuilder.
prepared
SQLite statements rendered once, with their parameter slots.
select
The SELECT builder: SelectBuilder and its states.
update
The UPDATE builder: UpdateBuilder and its states.

Structs§

BuilderInit
The state of a query builder before any statement has been started.
CTEInit
Builder state after QueryBuilder::with: the next call starts the statement that uses the common table expressions.
DeleteInitial
Marker for the initial state of DeleteBuilder.
DeleteReturningSet
Marker for the state after RETURNING clause.
DeleteWhereSet
Marker for the state after WHERE clause.
InsertColumnsSet
INSERT builder state after .columns(...), waiting for its SELECT source. Columns is the type-level list of target columns.
InsertDoUpdateSet
Marker for the state after DO UPDATE SET (before optional WHERE).
InsertInitial
Marker for the initial state of InsertBuilder.
InsertOnConflictSet
Marker for the state after ON CONFLICT is set.
InsertReturningSet
Marker for the state after RETURNING clause is added.
InsertValuesSet
Marker for the state after VALUES are set.
QueryBuilder
Type-safe SQL query builder for SQLite.
SQL
A SQL fragment: tokens, identifiers, raw text, and bound parameters.
SelectFromSet
Marker for the state after FROM clause.
SelectGroupSet
Marker for the state after GROUP BY clause.
SelectInitial
Marker for the initial state of SelectBuilder.
SelectJoinSet
Marker for the state after JOIN clause.
SelectLimitSet
Marker for the state after LIMIT clause.
SelectOffsetSet
Marker for the state after OFFSET clause.
SelectOrderSet
Marker for the state after ORDER BY clause.
SelectSetOpSet
Marker for the state after set operations (UNION/INTERSECT/EXCEPT).
SelectWhereSet
Marker for the state after WHERE clause.
UpdateInitial
Marker for the initial state of UpdateBuilder.
UpdateReturningSet
Marker for the state after RETURNING clause.
UpdateSetClauseSet
Marker for the state after SET clause.
UpdateWhereSet
Marker for the state after WHERE clause.

Enums§

OrderBy
Sort direction of an ORDER BY term.

Traits§

ExecutableState
Builder states whose query is complete and can be executed.
SQLSchema
A schema item (table, column, index, view, enum) with a name and its CREATE SQL.
SQLTable
A table for the dialect whose value type is Value.
ToSQL
Something that renders as a SQL fragment for the value type V.