Skip to main content

Module query

Module query 

Source
Expand description

Query analysis pipeline.

QueryAnalyzer is a tiny lexical scanner that:

  1. Detects the -- dactyl: <datastore> inline directive.
  2. Detects a fixed list of dialect-specific constructs.
  3. Returns Analyzed so the caller (lib.rs / the query! macro) can decide whether to rewrite, error, or pass through.

The rewriter itself is intentionally a no-op for the first pass — see the follow-up issue for the full plan. The pipeline is wired so swapping in the real rewriter is a one-function change.

Structs§

Analyzed
Outcome of analyzing a single query.
QueryAnalyzer
The analyzer. Cheap to construct; carries no state.

Enums§

Construct
A single dialect-specific construct the analyzer found in a query.
Dialect
SQL dialect an adapter speaks natively.
Rewrite
A no-op or trivial rewrite plan.

Functions§

dialect_of
Map a datastore name to its native dialect. Returns None for unknown names; callers should treat that as DactylError::UnknownDatastore.
first_unsupported
Decide whether the construct list is portable enough for the active dialect.