postgres

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package postgres provides SQL keyword constants for the PostgreSQL parser.

Package postgres implements a DDL parser for PostgreSQL schemas.

This parser supports PostgreSQL-specific DDL syntax including:

  • SERIAL/BIGSERIAL auto-increment types
  • JSONB and JSON types
  • Array types (TEXT[], INTEGER[], etc.)
  • UUID type
  • CREATE TYPE for enums
  • Domain constraints
  • PostgreSQL-specific syntax variations

Index

Constants

View Source
const (
	KeywordPrimary    = "PRIMARY"
	KeywordUnique     = "UNIQUE"
	KeywordForeign    = "FOREIGN"
	KeywordCheck      = "CHECK"
	KeywordConstraint = "CONSTRAINT"
	KeywordExclude    = "EXCLUDE"
)

SQL keywords used in PostgreSQL DDL parsing.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser implements diagnostic.SchemaParser for PostgreSQL dialect.

func New

func New() *Parser

New creates a new PostgreSQL schema parser.

func (*Parser) Parse

func (p *Parser) Parse(ctx context.Context, path string, content []byte) (*model.Catalog, []diagnostic.Diagnostic, error)

Parse parses PostgreSQL DDL content and returns a catalog.

Jump to

Keyboard shortcuts

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