postgresql

package
v0.49.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

README

PostgreSQL Parser Module

Build-tagged PostgreSQL parser adapter for parser wiring and parser-neutral extractor handoff.

Files

File Responsibility
parser.go Parses PostgreSQL SQL text and classifies statements when built with the postgresql tag
extractor.go Defines the PostgreSQL extracted-statement wrapper and extractor that populates normalized spec fields (column NotNull, Default, constraints) for ALTER TABLE ADD COLUMN statements
parser_stub.go Returns the PG-capable build guidance error when PostgreSQL support is not compiled in

Exports

  • Parser
  • Result
  • ExtractedStatement
  • New()
  • Parser.Parse(sql)

Dependencies

  • Upstream: internal/application/audit
  • Downstream: github.com/pganalyze/pg_query_go/v6, internal/domain/spec

Notes

  • The extractor populates CONSTR_NOTNULL and CONSTR_DEFAULT constraints on ALTER TABLE ADD COLUMN into the normalized spec column fields, enabling rules that depend on these facts.
  • The extractor normalizes advanced PostgreSQL CREATE INDEX forms (partial, expression, INCLUDE, non-btree access methods) into coarse spec.Index facts. DeltaScope does not render or semantically analyze predicate SQL or expression SQL.
  • This adapter only establishes the parser seam and normalized statement extraction.
  • Rich PostgreSQL statement extraction continues to expand across phases.

Update Rule

  • If members/interfaces/dependencies change, update this file in same change.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtractedStatement

type ExtractedStatement struct {
	Kind      spec.Kind
	RawSQL    string
	Extractor spec.StatementExtractor
}

type Parser

type Parser struct{}

func New

func New() *Parser

func (*Parser) Parse

func (p *Parser) Parse(_ string) (Result, error)

type Result

type Result struct {
	Statements []ExtractedStatement
	Warnings   []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL