pg

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Name       string
	DataType   string
	HasDefault bool
}

type Catalog

type Catalog struct {
	Schemas map[string]Schema
}

func NewCatalog

func NewCatalog() Catalog

func (Catalog) LookupFunctionN

func (c Catalog) LookupFunctionN(fqn FQN, argn int) (Function, error)

func (Catalog) LookupFunctions

func (c Catalog) LookupFunctions(fqn FQN) ([]Function, error)

type Column

type Column struct {
	Name     string
	DataType string
	NotNull  bool
	IsArray  bool
	Comment  string

	// XXX: Figure out what PostgreSQL calls `foo.id`
	Scope string
	Table FQN
}

type CompositeType added in v1.0.0

type CompositeType struct {
	Name string
}

type Enum

type Enum struct {
	Name    string
	Vals    []string
	Comment string
}

type Error

type Error struct {
	Message  string
	Code     string
	Hint     string
	Location int
}

func ErrorColumnAlreadyExists

func ErrorColumnAlreadyExists(rel, col string) Error

func ErrorColumnDoesNotExist

func ErrorColumnDoesNotExist(rel, col string) Error

func ErrorRelationAlreadyExists

func ErrorRelationAlreadyExists(rel string) Error

func ErrorRelationDoesNotExist

func ErrorRelationDoesNotExist(tbl string) Error

func ErrorSchemaAlreadyExists

func ErrorSchemaAlreadyExists(sch string) Error

func ErrorSchemaDoesNotExist

func ErrorSchemaDoesNotExist(sch string) Error

func ErrorTypeAlreadyExists

func ErrorTypeAlreadyExists(typ string) Error

func ErrorTypeDoesNotExist

func ErrorTypeDoesNotExist(typ string) Error

func (Error) Error

func (e Error) Error() string

type FQN

type FQN struct {
	Catalog string
	Schema  string
	Rel     string
}

func (FQN) String

func (f FQN) String() string

type Function

type Function struct {
	Name       string
	ArgN       int
	Arguments  []Argument // not recorded for builtins
	ReturnType string
	Comment    string
	Desc       string
}

type Schema

type Schema struct {
	Name    string
	Tables  map[string]Table
	Types   map[string]Type
	Funcs   map[string][]Function
	Comment string
}

func NewSchema

func NewSchema() Schema

func (Schema) Enums

func (s Schema) Enums() []Enum

type Table

type Table struct {
	ID      FQN
	Name    string
	Columns []Column
	Comment string
}

type Type added in v1.0.0

type Type interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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