>we need to ... understand SQL syntax using a parser, Rust ecosystem has a great library called pg_query
I'm impressed both that the Rust ecosystem had the right library available and that it was high enough quality code for the author's team to use it as a reference for building their own additional functionality.