Expand description
SQL AST and rendering.
Build SQL as a typed AST, then render to a string with automatic parameter numbering and formatting.
Structs§
- Column
Name - The name of a column or column alias.
- Column
Name Ref - The name of a column or column alias.
- Column
Ref - A column reference, optionally qualified with table/alias.
- Delete
Stmt - A DELETE statement.
- Fmt
- Wrapper for rendering a
Rendertype viaDisplay. - From
Clause - A FROM clause specifying the primary table.
- Ident
- A PostgreSQL identifier wrapper.
- Insert
Select Stmt - An INSERT … SELECT statement for bulk inserts.
- Insert
Stmt - 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.
- Param
Name - The name of a query parameter.
- Param
Name Ref - The name of a query parameter.
- PgType
- A PostgreSQL type name for casts.
- PgType
Ref - A PostgreSQL type name for casts.
- Render
Context - Rendering context that tracks parameter assignment.
- Rendered
Sql - Result of rendering SQL.
- Select
Stmt - A SELECT statement.
- Table
Name - The name of a table or table alias.
- Table
Name Ref - The name of a table or table alias.
- Unnest
- An UNNEST clause for bulk operations.
- Unnest
Param - A parameter in an UNNEST clause.
- Update
Assignment - A column assignment for UPDATE SET or ON CONFLICT DO UPDATE SET.
- Update
Stmt - An UPDATE statement.
Enums§
- BinOp
- Binary operators for SQL expressions.
- Conflict
Action - Action to take when a conflict occurs.
- Expr
- A SQL expression.
- Join
Kind - Type of JOIN.
- Nulls
Order - NULLS FIRST / NULLS LAST ordering for ORDER BY.
- Select
Column - 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.