InfluxElixir.Client.Local.SQLIdentifiers (InfluxElixir v0.1.35)

Copy Markdown View Source

DataFusion's identifier rules, applied to a SQL text before InfluxElixir.Client.Local.SQLParser reads it (verified against InfluxDB 3 Core):

  • an unquoted identifier is folded to lower case — column, table, alias and CTE names alike: SELECT Host FROM Cpu reads column host of table cpu, and AVG(v) AS Avg_V answers avg_v
  • a double-quoted identifier keeps its case: "Host" is column Host
  • string literals ('Abc') and $name placeholders are left as they are

A quoted identifier that is a plain word is written back bare, so the parser — which folds nothing — sees its exact name. One that needs its quotes (a space, a dot, a keyword such as "order") keeps them.

Summary

Functions

Folds unquoted identifiers to lower case and unwraps plain quoted ones.

Functions

normalize(sql)

@spec normalize(binary()) :: binary()

Folds unquoted identifiers to lower case and unwraps plain quoted ones.