Module lexer

Source
Expand description

SQL lexer.

This module lexes SQL according to the rules described in the “Lexical Structure” section of the PostgreSQL documentation. The description is intentionally not replicated here. Please refer to that chapter as you read the code in this module.

Where the PostgreSQL documentation is unclear, refer to their flex source instead, located in the backend/parser/scan.l file in the PostgreSQL Git repository.

Macros§

bail 🔒

Structs§

LexerError
PosToken

Enums§

Token

Constants§

MAX_IDENTIFIER_LENGTH
Maximum allowed identifier length in bytes.

Functions§

lex
Lexes a SQL query.
lex_dollar_string 🔒
lex_extended_string 🔒
lex_ident 🔒
lex_line_comment 🔒
lex_multiline_comment 🔒
lex_number 🔒
lex_op 🔒
lex_parameter 🔒
lex_quoted_ident 🔒
lex_string 🔒
lex_to_adjacent_string 🔒

Type Aliases§

IdentString
Newtype that limits the length of identifiers.