pganalyze / pg_query.rs

Rust library to parse, deparse and normalize SQL queries using the PostgreSQL query parser
MIT License
126 stars 12 forks source link

Support parsing complex queries with deeply nested ASTs #17

Open seanlinsley opened 1 year ago

seanlinsley commented 1 year ago

This matches the same behavior in the Ruby gem: https://github.com/pganalyze/pg_query/pull/238

Upstream changes were needed in the prost crate that haven't been merged yet: https://github.com/tokio-rs/prost/pull/785

Without further changes, the test suite would run into a stack overflow. There are some ways around this:

seanlinsley commented 1 year ago

Since any solution to the stack overflow issue would involve pulling in dependencies that most users won't need, I decided to document this issue in the README so downstream applications can increase the stack size as needed for their application.