Skip to main content

Crate turso_pg_parser

Crate turso_pg_parser 

Source

Modules§

translator

Enums§

ParseError

Functions§

fingerprint
Get a fingerprint for a query (for caching/deduplication)
get_tables
Get tables referenced in a query
normalize
Normalize a query (replace constants with $1, $2, etc.)
parse
Parse a PostgreSQL SQL statement using pg_query
quote_identifier
Quote an identifier following PostgreSQL’s server-side quote_identifier() rules: return it bare only when it is all lower-case ASCII letters, digits, and underscores, does not start with a digit, and is not a keyword outside the unreserved category; otherwise wrap it in double quotes with embedded quotes doubled.
split_statements
Split a multi-statement SQL string into individual statements. Uses pg_query’s scanner which correctly handles semicolons inside string literals, comments, and dollar-quoted strings. Returns the individual statement strings (without trailing semicolons).