Skip to main content

Module sql_parser

Module sql_parser 

Source
Expand description

Lightweight regex-based DDL extraction from SQL content.

Used by lint, changelog, and conflict detection features.

Structs§

LocatedDdl
A DDL operation together with its position in the source SQL.

Enums§

DdlOperation
A DDL operation extracted from SQL.

Functions§

blank_string_literals
Blank out the contents of every string literal, preserving byte offsets, line breaks and the surrounding quotes.
extract_ddl_operations
Extract DDL operations from SQL content.
extract_ddl_operations_located
Extract DDL operations along with their source positions.
line_number_at
The 1-based line number containing the given byte offset.
split_mysql_statements
Split MySQL SQL into individual statements at top-level ; terminators.
split_statements
Split SQL into individual statements, respecting dollar-quoted blocks, string literals, quoted identifiers, and comments.
strip_comments
Blank out every comment in sql, preserving byte offsets and line breaks.