Reads quoted text out of the way. Every clause of a SQL text is located by a
regular expression, and a string literal can hold anything: a comma, >,
limit 5, from t. So the text is masked first — the body of each '...'
or "..." becomes filler, byte for byte, the quotes stay — the expression
runs over the mask, and what it found is cut out of the original at the same
offsets.
The options say how a quoted token is read:
:blank— the filler byte (default?x):doubled— a doubled quote ('O''Brien') is one quote inside the literal, as in SQL (defaulttrue);falsereads'a''b'as two literals, as InfluxQL does:backslash— a backslash makes the next byte part of the literal, as in InfluxQL (defaultfalse):regex— a/.../that follows=~or!~is masked too, as an InfluxQL regular expression (defaultfalse):lenient— an unterminated literal is masked to the end of the text instead of raising (defaultfalse;InfluxElixir.Client.Local.SQLLexerrefuses such a text first, so SQL never reaches one)
Summary
Functions
Splits str at the parenthesis that closes the one already opened;
parentheses inside a quoted literal do not count.
The text a {start, length} capture covers, or "" for a group that did not match.
The text with the inside of every quoted string and quoted identifier blanked, byte for byte.
Regex.run/2 over the masked text, with the captures cut from text (an
unmatched optional group is ""); nil when the pattern does not match.
Splits at the commas outside parentheses and string literals.
Types
Functions
Splits str at the parenthesis that closes the one already opened;
parentheses inside a quoted literal do not count.
@spec cut( binary(), {integer(), non_neg_integer()} ) :: binary()
The text a {start, length} capture covers, or "" for a group that did not match.
The text with the inside of every quoted string and quoted identifier blanked, byte for byte.
Regex.run/2 over the masked text, with the captures cut from text (an
unmatched optional group is ""); nil when the pattern does not match.
Splits at the commas outside parentheses and string literals.