functions

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

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

Collection contains a collection of functions.

func Deserialize

func Deserialize(ctx context.Context, data []byte) (*Collection, error)

Deserialize returns the Collection that was serialized in the byte slice. Returns an empty Collection if data is nil or empty.

func Merge

func Merge(ctx context.Context, ourCollection, theirCollection, ancCollection *Collection) (*Collection, error)

Merge handles merging functions on our root and their root.

func (*Collection) AddFunction

func (pgf *Collection) AddFunction(f *Function) error

AddFunction adds a new function.

func (*Collection) Clone

func (pgf *Collection) Clone() *Collection

Clone returns a new *Collection with the same contents as the original.

func (*Collection) DropFunction

func (pgf *Collection) DropFunction(funcID id.Function) error

DropFunction drops an existing function.

func (*Collection) GetFunction

func (pgf *Collection) GetFunction(funcID id.Function) *Function

GetFunction returns the function with the given ID. Returns nil if the function cannot be found.

func (*Collection) GetFunctionOverloads

func (pgf *Collection) GetFunctionOverloads(funcID id.Function) []*Function

GetFunctionOverloads returns the overloads for the function matching the schema and the function name. The parameter types are ignored when searching for overloads.

func (*Collection) HasFunction

func (pgf *Collection) HasFunction(funcID id.Function) bool

HasFunction returns whether the function is present.

func (*Collection) IterateFunctions

func (pgf *Collection) IterateFunctions(callback func(f *Function) error) error

IterateFunctions iterates over all functions in the collection.

func (*Collection) Serialize

func (pgf *Collection) Serialize(ctx context.Context) ([]byte, error)

Serialize returns the Collection as a byte slice. If the Collection is nil, then this returns a nil slice.

type Function

type Function struct {
	ID                 id.Function
	ReturnType         id.Type
	ParameterNames     []string
	ParameterTypes     []id.Type
	Variadic           bool
	IsNonDeterministic bool
	Strict             bool
	Operations         []plpgsql.InterpreterOperation
}

Function represents a created function.

Jump to

Keyboard shortcuts

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