catalog

package
v0.0.0-...-230ac96 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name     string
	TypeOID  OID
	NotNull  bool
	Position int
}

type Function

type Function struct {
	OID           OID
	Name          Name
	IdentityArgs  string
	Volatility    FunctionVolatility
	Strict        bool
	ReturnTypeOID OID
}

type FunctionVolatility

type FunctionVolatility uint8
const (
	VolatilityImmutable FunctionVolatility = iota + 1
	VolatilityStable
	VolatilityVolatile
)

type Name

type Name struct {
	Schema string
	Name   string
}

Name is a canonical catalog name. Schema is empty when the source reference is still unqualified.

func (Name) String

func (n Name) String() string

type OID

type OID uint32

OID is a PostgreSQL object identifier.

type Queryer

type Queryer interface {
	Query(ctx context.Context, sql string, args ...any) (Rows, error)
}

type Relation

type Relation struct {
	OID     OID
	Name    Name
	Kind    RelationKind
	Owner   string
	Columns []Column
}

type RelationKind

type RelationKind uint8
const (
	RelationTable RelationKind = iota + 1
	RelationPartitionedTable
	RelationView
	RelationMaterializedView
	RelationForeignTable
	RelationSequence
)

func (RelationKind) String

func (k RelationKind) String() string

type ResolvedFunction

type ResolvedFunction struct {
	Function Function
	Reason   UnresolvedReason
}

func ResolveFunctionByOID

func ResolveFunctionByOID(snap Snapshot, oid OID) ResolvedFunction

func (ResolvedFunction) OK

func (r ResolvedFunction) OK() bool

type ResolvedRelation

type ResolvedRelation struct {
	Relation Relation
	Reason   UnresolvedReason
}

func ResolveRelation

func ResolveRelation(snap Snapshot, name Name, searchPath []string) ResolvedRelation

func (ResolvedRelation) OK

func (r ResolvedRelation) OK() bool

type Rows

type Rows interface {
	Next() bool
	Scan(dest ...any) error
	Close() error
	Err() error
}

type Snapshot

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

func LoadPostgresSnapshot

func LoadPostgresSnapshot(ctx context.Context, q Queryer) (Snapshot, error)

func NewSnapshot

func NewSnapshot(relations []Relation, functions []Function) Snapshot

func (Snapshot) FunctionByOID

func (s Snapshot) FunctionByOID(oid OID) (Function, bool)

func (Snapshot) FunctionsByName

func (s Snapshot) FunctionsByName(name Name) []Function

func (Snapshot) RelationByName

func (s Snapshot) RelationByName(name Name) (Relation, bool)

func (Snapshot) RelationByOID

func (s Snapshot) RelationByOID(oid OID) (Relation, bool)

func (Snapshot) RelationsByUnqualifiedName

func (s Snapshot) RelationsByUnqualifiedName(name string) []Relation

type UnresolvedReason

type UnresolvedReason uint8
const (
	UnresolvedNone UnresolvedReason = iota
	UnresolvedMissing
	UnresolvedAmbiguous
	UnresolvedUnsupported
	UnresolvedCatalogError
)

func (UnresolvedReason) String

func (r UnresolvedReason) String() string

Jump to

Keyboard shortcuts

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