Expand description
Facet types for the dibs query DSL schema.
These types define the structure of .styx query files and can be:
- Deserialized from styx using facet-styx
- Used to generate a styx schema via facet-styx’s schema generation
- Used by the LSP extension for diagnostics, hover, go-to-definition
Structs§
- Conflict
Target - Conflict target columns.
- Conflict
Update - Columns to update on conflict.
- Delete
- A DELETE declaration.
- Distinct
On - DISTINCT ON clause (PostgreSQL-specific) - a sequence of column names.
- Insert
- An INSERT declaration.
- Insert
Many - A bulk INSERT declaration (insert multiple rows with a single query).
- Meta
- A value with source span and documentation.
- OnConflict
- ON CONFLICT clause for UPSERT.
- OrderBy
- ORDER BY clause.
- Params
- Query parameters.
- Query
File - A query file - top level is a map of declaration names to declarations.
Uses
Meta<String>as keys to capture doc comments from the styx file. - Relation
- A relation definition (nested query on related table).
- Returning
- RETURNING clause.
- Returns
- Return type specification for raw SQL queries.
- Select
- A SELECT query definition.
- Select
Fields - SELECT clause.
- Span
- Source span with offset and length.
- Update
- An UPDATE declaration.
- Upsert
- An UPSERT declaration (INSERT … ON CONFLICT … DO UPDATE).
- Upsert
Many - A bulk UPSERT declaration (upsert multiple rows with a single query).
- Values
- Values clause for INSERT/UPDATE.
- Where
- WHERE clause - filter conditions.
Enums§
- Decl
- A declaration in a query file.
- Field
Def - A field definition - tagged values in select.
- Filter
Value - A filter value - tagged operators or bare scalars for where clauses.
- Param
Type - Parameter type.
- Payload
- Payload of a value expression - can be scalar or sequence.
- Update
Value - Value for an update column - mirrors
ValueExpr. - Value
Expr - A value expression in INSERT/UPDATE.
Traits§
- Option
Meta Copy Ext - Extension trait for
Option<Meta<T>>where T is Copy (like bool). - Option
Meta Deref Ext - Extension trait for
Option<Meta<T>>to get references to the inner value. - Option
Meta Ext - Extension trait for
Option<Meta<T>>to make access more ergonomic.
Functions§
- normalize_
schema_ tag_ payload_ spacing - Normalize schema strings rendered by facet-styx so tag payloads stay attached.
- query_
file_ schema - Generate a parseable Styx schema for
QueryFile.