Reads a SQL text as the engine's tokenizer does, before
InfluxElixir.Client.Local.SQLParser looks at it (verified against
InfluxDB 3 Core):
-- ...to the end of the line, and/* ... */(which nest), are comments and leave no trace: a quote inside one opens nothing'...'is a string and"..."a quoted identifier; inside either, a doubled quote is one quote and nothing else has a meaning$$...$$and$tag$...$tag$are dollar-quoted strings, andE'...'ore'...'a string with backslash escapes, rewritten as ordinary'...'literals;$nameis a placeholder and is keptX'...'is a binary value, which the double refuses by name;ends a statement; empty statements are nothing, so a trailing;is fine
A text the tokenizer cannot read is its SQL error: TokenizerError(...)
400, naming the line and column (counted in characters) where the
unterminated string, quoted identifier or dollar-quoted string began, or
where the text ended for an unterminated comment or a dollar-quoted string
whose end is missing. A text with no statement is the planner's 400, and
one with several is the engine's 405.
Summary
Functions
The statement the text holds, with comments removed and dollar-quoted
strings written as '...' literals, or the engine's error.
Functions
@spec scrub(binary()) :: {:ok, binary()} | {:error, InfluxElixir.Client.Local.SQLError.t()}
The statement the text holds, with comments removed and dollar-quoted
strings written as '...' literals, or the engine's error.