Discover Packages
github.com/KARTIKrocks/sqlguard/parsers/pgparser
package
module
Version:
v0.5.0
Opens a new window with list of versions in this module.
Published: Sep 25, 2026
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: ? modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package pgparser is an optional sqlguard Parser backed by a real
PostgreSQL grammar (github.com/auxten/postgresql-parser, pure Go, no cgo).
It produces exact, structural answers for the false-positive-prone facts
(statement kind, WHERE/LIMIT/ORDER BY/FROM presence, SELECT *, explicit
INSERT columns) instead of regex guesses. SQL the grammar rejects —
dynamic fragments, dialect extensions, driver placeholders it can't
handle — transparently degrades to sqlguard's zero-dependency
FallbackParser, so analysis never breaks the caller's query path.
Usage:
sqlguard.Register("sqlguard-pg", "pgx", middleware.WithParser(pgparser.New()))
db, _ := sql.Open("sqlguard-pg", dsn)
Parser implements analyzer.Parser using a PostgreSQL grammar.
New returns a Postgres-dialect Parser that falls back to the
zero-dependency FallbackParser on parse failure.
Parse implements analyzer.Parser. It never returns an error: unparseable
SQL yields the fallback parser's best-effort Statement (Exact=false).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.