Skip to main content

Crate dibs_sql

Crate dibs_sql 

Source
Expand description

SQL AST and rendering.

Build SQL as a typed AST, then render to a string with automatic parameter numbering and formatting.

Structs§

ColumnName
The name of a column or column alias.
ColumnNameRef
The name of a column or column alias.
ColumnRef
A column reference, optionally qualified with table/alias.
DeleteStmt
A DELETE statement.
Fmt
Wrapper for rendering a Render type via Display.
FromClause
A FROM clause specifying the primary table.
Ident
A PostgreSQL identifier wrapper.
InsertSelectStmt
An INSERT … SELECT statement for bulk inserts.
InsertStmt
An INSERT statement.
Join
A JOIN clause.
Lit
A PostgreSQL string literal wrapper.
OnConflict
ON CONFLICT clause for upsert behavior.
OrderBy
ORDER BY clause for sorting query results.
ParamName
The name of a query parameter.
ParamNameRef
The name of a query parameter.
PgType
A PostgreSQL type name for casts.
PgTypeRef
A PostgreSQL type name for casts.
RenderContext
Rendering context that tracks parameter assignment.
RenderedSql
Result of rendering SQL.
SelectStmt
A SELECT statement.
TableName
The name of a table or table alias.
TableNameRef
The name of a table or table alias.
Unnest
An UNNEST clause for bulk operations.
UnnestParam
A parameter in an UNNEST clause.
UpdateAssignment
A column assignment for UPDATE SET or ON CONFLICT DO UPDATE SET.
UpdateStmt
An UPDATE statement.

Enums§

BinOp
Binary operators for SQL expressions.
ConflictAction
Action to take when a conflict occurs.
Expr
A SQL expression.
JoinKind
Type of JOIN.
NullsOrder
NULLS FIRST / NULLS LAST ordering for ORDER BY.
SelectColumn
A column in a SELECT clause.
Stmt
A SQL statement.

Traits§

Render
Trait for types that can be rendered to SQL.

Functions§

check_constraint_name
Generate a deterministic CHECK constraint name for a table and expression.
escape_string
Escape a string literal for SQL.
index_name
Generate a standard index name for a table and columns.
quote_ident
Quote a PostgreSQL identifier.
render
Render a statement to SQL.
trigger_check_function_name
Derive the trigger function name for a trigger-enforced check.
trigger_check_name
Generate a deterministic trigger name for a trigger-enforced check.
unique_index_name
Generate a standard unique index name for a table and columns.