catalog

package
v0.0.0-...-cf8cdd1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 4 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
	Type       *ast.TypeName
	HasDefault bool
	Mode       ast.FuncParamMode
}

type Catalog

type Catalog struct {
	Name    string
	Schemas []*Schema
	Comment string

	SearchPath    []string
	DefaultSchema string
}

func New

func New(def string) *Catalog

func (*Catalog) Build

func (c *Catalog) Build(stmts []ast.Statement) error

func (*Catalog) GetFuncN

func (c *Catalog) GetFuncN(rel *ast.FuncName, n int) (Function, error)

func (*Catalog) GetTable

func (c *Catalog) GetTable(rel *ast.TableName) (Table, error)

func (*Catalog) ListFuncsByName

func (c *Catalog) ListFuncsByName(rel *ast.FuncName) ([]Function, error)

func (*Catalog) Update

func (c *Catalog) Update(stmt ast.Statement) error

type Column

type Column struct {
	Name      string
	Type      ast.TypeName
	IsNotNull bool
	IsArray   bool
	Comment   string
}

TODO: Should this just be ast Nodes?

type CompositeType

type CompositeType struct {
	Name    string
	Comment string
}

func (*CompositeType) SetComment

func (ct *CompositeType) SetComment(c string)

type Enum

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

func (*Enum) SetComment

func (e *Enum) SetComment(c string)

type Function

type Function struct {
	Name       string
	Args       []*Argument
	ReturnType *ast.TypeName
	Comment    string
	Desc       string
}

func (*Function) InArgs

func (f *Function) InArgs() []*Argument

type Schema

type Schema struct {
	Name   string
	Tables []*Table
	Types  []Type
	Funcs  []*Function

	Comment string
}

type Table

type Table struct {
	Rel     *ast.TableName
	Columns []*Column
	Comment string
}

type Type

type Type interface {
	SetComment(string)
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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