Skip to main content

parse

Function parse 

Source
pub fn parse(source: &str, dialect: Dialect) -> ParsedFile
Expand description

Parse a whole SQL document. Always succeeds; per-statement errors are collected into ParsedFile::errors.

Backend dispatch:

  • Dialect::Postgres – uses the libpg_query backend when compiled in (matches real PG semantics), otherwise the sqlparser-rs PostgreSqlDialect.
  • Dialect::MySql / Dialect::SQLite / Dialect::Generic – always uses sqlparser-rs with the matching dialect. libpg_query is PG-only and would mis-parse these.