{"repo":"ValkDB/postgresparser","free":true,"listed":false,"github":"https://github.com/ValkDB/postgresparser","clone":"git clone https://github.com/ValkDB/postgresparser.git","description":"ANTLR-based PostgreSQL query parser for Go. Extracts tables, columns, joins, CTEs, parameters, DDL actions, and full column-usage metadata from SQL into a structured IR.","language":"Go","stars":265,"topics":["antlr","database","developer-tools","go","postgresql","sql-parser","postgres"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"postgresparser A pure-Go PostgreSQL parser. No cgo, no C toolchain — just go build . Why postgresparser? Need to parse PostgreSQL SQL in Go but can't use cgo? Deploying to Alpine containers, Lambda, ARM, scratch images, or anywhere that requires CGO ENABLED=0 ? postgresparser works everywhere go build works. It parses SQL into a structured intermediate representation (IR) that gives you tables, columns, joins, filters, CTEs, subqueries, and more — without executing anything. For multi-statement behavior and strict mode, see Statement Count Handling. Performance: With SLL prediction mode, most queries parse in 70–350 µs . Installation What you can build with it - Query linting — detect missing WHERE on DELETEs, flag SELECT , enforce naming conventions - Dependency extraction — map which tables and columns a query touches, build lineage graphs - Migration tooling — parse DDL to understand schema changes, diff CREATE statements - Audit logging — tag log entries with structured metadata (tables, operation type, filtered columns) - Query rewriting — inject tenant filters, add audit columns, transform SQL before execution - Index advisors — analyze column usage patterns to suggest optimal indexes Parsing Handles the SQL you actually write in production: - DML : SELECT, INSERT, UPDATE, DELETE, MERGE - DDL : CREATE TABLE (columns/type/nullability/default + PK/FK/UNIQUE/CHECK constraints), CREATE INDEX, DROP TABLE/INDEX, ALTER TABLE, TRUNCATE, COMMENT ON - CTEs : WITH ... AS including","default_branch":null,"files":null,"tree":[],"storefront":"/r/ValkDB","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ValkDB/postgresparser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}