ValkDB

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.

193
8
100% credibility
Found Feb 09, 2026 at 98 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Go
AI Summary

A pure-Go PostgreSQL SQL parser that extracts structured metadata like tables, columns, joins, and filters from queries without execution.

How It Works

1
🔍 Discover the SQL reader

You find a friendly tool that reads and understands PostgreSQL queries without running them, perfect for checking what they do.

2
📦 Add to your project

You easily include it in your Go application with a simple command, no complicated setups needed.

3
💻 Feed it a query

Paste any SQL query into your code, and it starts reading it like a story.

4
Unlock query secrets

Instantly see the tables, columns, joins, filters, and more in a clear structured list.

5
📊 Dive deeper with analysis

Use extra smarts to spot column roles, extract conditions, or detect table links.

6
🛠️ Build helpful tools

Create query checkers, migration helpers, or audit logs that make your work safer and faster.

🎉 Queries mastered

Your app now perfectly understands every SQL query, saving time and catching issues early.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 98 to 193 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is postgresparser?

Postgresparser is a pure-Go PostgreSQL parser on GitHub that extracts tables, columns, joins, CTEs, parameters, DDL actions, and full column-usage metadata from SQL queries into a structured intermediate representation. It handles production DML like SELECT with window functions and upserts, plus DDL for CREATE TABLE/INDEX and ALTER/DROP, without needing a Postgres server or cgo dependencies. Developers get fast parsing (70-350 µs) deployable anywhere Go builds run, like Lambda or Alpine containers.

Why is it gaining traction?

This ANTLR-based parser stands out for its no-cgo purity, enabling serverless and cross-platform use where C toolchains fail. It delivers rich analysis like column-usage roles (filter, join, projection), WHERE condition extraction, and schema-aware JOIN relationships—features rivals often lack or require heavy dependencies. The hook is building tools like query linters, lineage graphs, or rewriters with precise metadata on real-world SQL including JSONB ops and set operations.

Who should use this?

Go backend engineers parsing SQL for audit logging, migration diffing, or tenant isolation in multi-tenant apps. Database ops teams creating index advisors or dependency mappers from query logs. Anyone needing DDL extraction for schema change detectors without spinning up Postgres instances.

Verdict

Solid pick for Go SQL analysis tools—117 stars and 1.0% credibility score signal early maturity, but strong docs, examples, and tests make it production-ready for prototypes. Skip if you need 100% Postgres grammar fidelity; otherwise, integrate via `go get` and iterate fast.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.