The literals and names of a SQL text, as DataFusion reads them (verified against InfluxDB 3 Core):
'...'is a string, in which a doubled quote is one quote: a quoted literal is a string, full stop — re-typing'08338636'as an integer would drop the leading zero and change the type"..."is always an identifier, never a string:host = "x"compares the columnhostwith the columnx- a bare
true,falseor number is typed; anything else bare is a name $nameis a placeholder; a name is word characters in any script
The text reaching here has been through InfluxElixir.Client.Local.SQLLexer
and InfluxElixir.Client.Local.SQLIdentifiers, so a double-quoted token
that is left holds a name that needs its quotes.
Summary
Functions
The text between a literal's quotes, with a doubled quote one quote. The quotes are one byte each, so the cut is by bytes, as every offset here is.
Types a bare literal: integer, then float, else leaves it as a string.
Whether the text is a float literal (1.5, .5, 1e5); an integer is not.
The value of a number token (1.5, .5, 1., 1e5, or digits only), read
as a Rust f64 is: correctly rounded, 0.0 on underflow, and :nonfinite
past the largest double, which the engine holds as infinity.
Whether the text is one "..." identifier.
The name a "..." identifier holds, a doubled quote one quote.
Whether the text is an integer literal.
Whether the text is a string, a boolean or a number, one past the range of
a double (1e400) included.
Whether the text is a $name placeholder.
The $name placeholder's name, or nil.
A float literal's value, with the {float, rest} of Float.parse/1, or :error.
text as a '...' literal, a quote doubled.
How the engine words a column name in an error: bare when it is a lower case word, otherwise quoted with its quotes doubled.
Whether the text is one '...' literal, not two joined by an operator.
'it''s''s body is the text it's.
A literal as a value: a quoted one is a string, only a bare one is typed,
$name is {:param, name}.
Types
Functions
The text between a literal's quotes, with a doubled quote one quote. The quotes are one byte each, so the cut is by bytes, as every offset here is.
Types a bare literal: integer, then float, else leaves it as a string.
Whether the text is a float literal (1.5, .5, 1e5); an integer is not.
The value of a number token (1.5, .5, 1., 1e5, or digits only), read
as a Rust f64 is: correctly rounded, 0.0 on underflow, and :nonfinite
past the largest double, which the engine holds as infinity.
Whether the text is one "..." identifier.
The name a "..." identifier holds, a doubled quote one quote.
Whether the text is an integer literal.
Whether the text is a string, a boolean or a number, one past the range of
a double (1e400) included.
Whether the text is a $name placeholder.
The $name placeholder's name, or nil.
A float literal's value, with the {float, rest} of Float.parse/1, or :error.
text as a '...' literal, a quote doubled.
How the engine words a column name in an error: bare when it is a lower case word, otherwise quoted with its quotes doubled.
Whether the text is one '...' literal, not two joined by an operator.
'it''s''s body is the text it's.
A literal as a value: a quoted one is a string, only a bare one is typed,
$name is {:param, name}.