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 (...)) forSQLite. - delete
- The DELETE builder:
DeleteBuilderand its states. - insert
- The INSERT builder:
InsertBuilder, its states, andOnConflictBuilder. - prepared
SQLitestatements rendered once, with their parameter slots.- select
- The SELECT builder:
SelectBuilderand its states. - update
- The UPDATE builder:
UpdateBuilderand its states.
Structs§
- Builder
Init - 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. - Delete
Initial - Marker for the initial state of
DeleteBuilder. - Delete
Returning Set - Marker for the state after RETURNING clause.
- Delete
Where Set - Marker for the state after WHERE clause.
- Insert
Columns Set - INSERT builder state after
.columns(...), waiting for its SELECT source.Columnsis the type-level list of target columns. - Insert
DoUpdate Set - Marker for the state after DO UPDATE SET (before optional WHERE).
- Insert
Initial - Marker for the initial state of
InsertBuilder. - Insert
OnConflict Set - Marker for the state after ON CONFLICT is set.
- Insert
Returning Set - Marker for the state after RETURNING clause is added.
- Insert
Values Set - Marker for the state after VALUES are set.
- Query
Builder - Type-safe SQL query builder for
SQLite. - SQL
- A SQL fragment: tokens, identifiers, raw text, and bound parameters.
- Select
From Set - Marker for the state after FROM clause.
- Select
Group Set - Marker for the state after GROUP BY clause.
- Select
Initial - Marker for the initial state of
SelectBuilder. - Select
Join Set - Marker for the state after JOIN clause.
- Select
Limit Set - Marker for the state after LIMIT clause.
- Select
Offset Set - Marker for the state after OFFSET clause.
- Select
Order Set - Marker for the state after ORDER BY clause.
- Select
SetOp Set - Marker for the state after set operations (UNION/INTERSECT/EXCEPT).
- Select
Where Set - Marker for the state after WHERE clause.
- Update
Initial - Marker for the initial state of
UpdateBuilder. - Update
Returning Set - Marker for the state after RETURNING clause.
- Update
SetClause Set - Marker for the state after SET clause.
- Update
Where Set - Marker for the state after WHERE clause.
Enums§
- OrderBy
- Sort direction of an
ORDER BYterm.
Traits§
- Executable
State - Builder states whose query is complete and can be executed.
- SQLSchema
- A schema item (table, column, index, view, enum) with a name and its
CREATESQL. - SQLTable
- A table for the dialect whose value type is
Value. - ToSQL
- Something that renders as a
SQLfragment for the value typeV.