pg_query 0.1.0

PostgreSQL parser that uses the actual PostgreSQL server source to parse SQL queries and return the internal PostgreSQL parse tree.
docs.rs failed to build pg_query-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: pg_query-5.1.0

pg_query.rs   Build Status Latest Version Docs Badge

PostgreSQL parser that uses the actual PostgreSQL server source to parse SQL queries and return the internal PostgreSQL parse tree.

Warning! This library is in early stages of development so any APIs exposed are subject to change.

Example: Parsing a query

use pg_query::ast::Node;

let result = pg_query::parse("SELECT * FROM contacts");
assert!(result.is_ok());
let result = result.unwrap();
assert!(matches!(*&result[0], Node::SelectStmt(_)));