pganalyze/pg_query: Ruby extension to parse, deparse and normalize SQL queries using the PostgreSQL query parser

06-Dec-2024 1459
This Ruby extension uses the actual PostgreSQL server source to parse SQL queries and return the internal PostgreSQL parsetree. In addition the extension allows you to normalize queries (replacing constant values with $n) and parse these normalized queries into a parsetree again. When you build this extension, it builds parts of the PostgreSQL server source (see libpg_query), and then statically links it into this extension. This may seem like a lot of complexity, but is the only reliable way of parsing all valid PostgreSQL queries. .

Free eBook download

Download all our eBooks for free from Gumroad!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these books offer thousands of essential questions and answers across multiple languages. Download the complete collection for free from our Gumroad page. Free Ultimate Job Interview Preparation eBook collection