Skip to main content

Crate dibs_query_schema

Crate dibs_query_schema 

Source
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§

ConflictTarget
Conflict target columns.
ConflictUpdate
Columns to update on conflict.
Delete
A DELETE declaration.
DistinctOn
DISTINCT ON clause (PostgreSQL-specific) - a sequence of column names.
Insert
An INSERT declaration.
InsertMany
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.
QueryFile
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.
SelectFields
SELECT clause.
Span
Source span with offset and length.
Update
An UPDATE declaration.
Upsert
An UPSERT declaration (INSERT … ON CONFLICT … DO UPDATE).
UpsertMany
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.
FieldDef
A field definition - tagged values in select.
FilterValue
A filter value - tagged operators or bare scalars for where clauses.
ParamType
Parameter type.
Payload
Payload of a value expression - can be scalar or sequence.
UpdateValue
Value for an update column - mirrors ValueExpr.
ValueExpr
A value expression in INSERT/UPDATE.

Traits§

OptionMetaCopyExt
Extension trait for Option<Meta<T>> where T is Copy (like bool).
OptionMetaDerefExt
Extension trait for Option<Meta<T>> to get references to the inner value.
OptionMetaExt
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.