postgresql

package
v0.0.0-...-bdbe55d Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package postgresql generates the PostgreSQL dialect seed under internal/engine/postgresql/dialect from a live server: pg_catalog's functions, the relations of pg_catalog and information_schema, and one directory per contrib extension holding the types and functions CREATE EXTENSION adds. types.jsonl and operators.jsonl at the top of the dialect are written by hand and are not this package's business.

The server is named by POSTGRESQL_SERVER_URI and has to be the major release in Major, since each release adds to its catalogs.

Index

Constants

View Source
const Engine = "postgresql"

Engine is the name of the engine directory the dialect lives under.

View Source
const Major = 16

Major is the PostgreSQL major release the dialect is generated from. Bumping it is a deliberate change: every release adds functions and catalog columns, so regenerate and review the dialect after changing it.

Variables

This section is empty.

Functions

func Generate

func Generate(ctx context.Context, url string) (dialect.Files, error)

Generate reads the dialect from the server. It creates every contrib extension it describes, so the server's contrib package has to be installed.

func Locate

func Locate() (string, error)

Locate returns the server to generate from, named by POSTGRESQL_SERVER_URI.

func Version

func Version(ctx context.Context, url string) (string, error)

Version reports the release a server is.

Types

type Arg

type Arg struct {
	Name       string
	Mode       string
	Type       string
	HasDefault bool
}

func (*Arg) TypeName

func (a *Arg) TypeName() string

type Proc

type Proc struct {
	Name       string
	ReturnType string
	ArgTypes   []string
	ArgNames   []string
	HasDefault []string
	ArgModes   []string
}

func (*Proc) Args

func (p *Proc) Args() []Arg

func (*Proc) ReturnTypeName

func (p *Proc) ReturnTypeName() string

type Relation

type Relation struct {
	Catalog    string
	SchemaName string
	Name       string
	Columns    []RelationColumn
}

type RelationColumn

type RelationColumn struct {
	Name      string
	Type      string
	IsNotNull bool
	IsArray   bool
	Length    *int
}

Jump to

Keyboard shortcuts

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