Skip to main content

Module lexer

Module lexer 

Source
Expand description

Lexical boundaries of SQL text under one backend’s rules: where quoted text, comments, parameters and words begin and end. It is not a grammar.

The builder finds the markers of SQL fragments with it, the engine reads raw statements with it, and TideORM inspects the SQL it runs with it.

Structs§

Token
One lexical unit of a statement.

Enums§

Dialect
Whose lexical rules a scan follows.
EscapeMode
How a quoted run escapes its closing quote.
Kind
What a Token is.
QuotedRun
How a quoted run ends.

Functions§

block_comment_len
The length of the block comment opening sql, to the end of sql when it is not closed.
dollar_tag_len
The length of the PostgreSQL dollar-quote delimiter opening sql, $$ or $tag$, whose tag does not start with a digit.
identifier_char
Whether c can continue an unquoted identifier.
quoted_end
Scan after an opening delimiter. Positions may be bytes or character indices; callers supply the corresponding width and end so validation stays allocation-free.
quoted_len
The length of the quoted run sql opens with delimiter ([ closes with ]), to the end of sql when it is not closed.
tokens
The tokens of sql under dialect’s rules, lexed only as far as the caller reads.