Documentation
¶
Index ¶
- Constants
- func FunctionIDToTableName(funcID id.Function) doltdb.TableName
- type Collection
- func (pgf *Collection) AddFunction(ctx context.Context, f Function) error
- func (pgf *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
- func (pgf *Collection) DiffRootObjects(ctx context.Context, fromHash string, o objinterface.RootObject, ...) ([]objinterface.RootObjectDiff, objinterface.RootObject, error)
- func (pgf *Collection) DropFunction(ctx context.Context, funcIDs ...id.Function) error
- func (pgf *Collection) DropRootObject(ctx context.Context, identifier id.Id) error
- func (pgf *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
- func (pgf *Collection) GetFunction(ctx context.Context, funcID id.Function) (Function, error)
- func (pgf *Collection) GetFunctionOverloads(ctx context.Context, funcID id.Function) ([]Function, error)
- func (pgf *Collection) GetID() objinterface.RootObjectID
- func (pgf *Collection) GetRootObject(ctx context.Context, identifier id.Id) (objinterface.RootObject, bool, error)
- func (*Collection) HandleMerge(ctx context.Context, mro merge.MergeRootObject) (doltdb.RootObject, *merge.MergeStats, error)
- func (pgf *Collection) HasFunction(ctx context.Context, funcID id.Function) bool
- func (pgf *Collection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)
- func (pgf *Collection) IDToTableName(identifier id.Id) doltdb.TableName
- func (pgf *Collection) IterAll(ctx context.Context, ...) error
- func (pgf *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
- func (pgf *Collection) IterateFunctions(ctx context.Context, callback func(f Function) (stop bool, err error)) error
- func (*Collection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
- func (pgf *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
- func (pgf *Collection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error
- func (pgf *Collection) ResolveName(ctx context.Context, name doltdb.TableName) (doltdb.TableName, id.Id, error)
- func (*Collection) ResolveNameFromObjects(ctx context.Context, name doltdb.TableName, ...) (doltdb.TableName, id.Id, error)
- func (*Collection) Serializer() objinterface.RootObjectSerializer
- func (pgf *Collection) TableNameToID(name doltdb.TableName) id.Id
- func (pgf *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, ...) (objinterface.RootObject, error)
- type Function
- func (function Function) GetID() id.Id
- func (function Function) GetInnerDefinition() string
- func (function Function) GetRootObjectID() objinterface.RootObjectID
- func (function Function) HashOf(ctx context.Context) (hash.Hash, error)
- func (function Function) Name() doltdb.TableName
- func (function Function) ReplaceDefinition(newInner string) string
- func (function Function) Serialize(ctx context.Context) ([]byte, error)
Constants ¶
const ( FIELD_NAME_PARAMETERS = "parameters" FIELD_NAME_RETURN_TYPE = "return_type" FIELD_NAME_NON_DETERMINISTIC = "non_deterministic" FIELD_NAME_STRICT = "strict" FIELD_NAME_DEFINITION = "definition" FIELD_NAME_EXTENSION_NAME = "extension_name" FIELD_NAME_EXTENSION_SYMBOL = "extension_symbol" FIELD_NAME_SQL_DEFINITION = "sql_definition" FIELD_NAME_SET_OF = "set_of" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collection ¶
type Collection struct {
objinterface.RootObjectMap
// contains filtered or unexported fields
}
Collection contains a collection of functions.
func LoadFunctions ¶ added in v0.50.0
func LoadFunctions(ctx context.Context, root objinterface.RootValue) (*Collection, error)
LoadFunctions loads the functions collection from the given root.
func NewCollection ¶ added in v0.50.0
func NewCollection(ctx context.Context, rom objinterface.RootObjectMap) (*Collection, error)
NewCollection returns a new Collection.
func (*Collection) AddFunction ¶
func (pgf *Collection) AddFunction(ctx context.Context, f Function) error
AddFunction adds a new function.
func (*Collection) DeserializeRootObject ¶ added in v0.51.1
func (pgf *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
DeserializeRootObject implements the interface objinterface.Collection.
func (*Collection) DiffRootObjects ¶ added in v0.51.1
func (pgf *Collection) DiffRootObjects(ctx context.Context, fromHash string, o objinterface.RootObject, t objinterface.RootObject, a objinterface.RootObject) ([]objinterface.RootObjectDiff, objinterface.RootObject, error)
DiffRootObjects implements the interface objinterface.Collection.
func (*Collection) DropFunction ¶
DropFunction drops an existing function.
func (*Collection) DropRootObject ¶ added in v0.50.0
DropRootObject implements the interface objinterface.Collection.
func (*Collection) GetFieldType ¶ added in v0.51.1
func (pgf *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
GetFieldType implements the interface objinterface.Collection.
func (*Collection) GetFunction ¶
GetFunction returns the function with the given ID. Returns a function with an invalid ID if it cannot be found (Function.ID.IsValid() == false).
func (*Collection) GetFunctionOverloads ¶
func (pgf *Collection) GetFunctionOverloads(ctx context.Context, funcID id.Function) ([]Function, error)
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) GetID ¶ added in v0.50.0
func (pgf *Collection) GetID() objinterface.RootObjectID
GetID implements the interface objinterface.Collection.
func (*Collection) GetRootObject ¶ added in v0.50.0
func (pgf *Collection) GetRootObject(ctx context.Context, identifier id.Id) (objinterface.RootObject, bool, error)
GetRootObject implements the interface objinterface.Collection.
func (*Collection) HandleMerge ¶ added in v0.50.0
func (*Collection) HandleMerge(ctx context.Context, mro merge.MergeRootObject) (doltdb.RootObject, *merge.MergeStats, error)
HandleMerge implements the interface objinterface.Collection.
func (*Collection) HasFunction ¶
HasFunction returns whether the function is present.
func (*Collection) HasRootObject ¶ added in v0.50.0
HasRootObject implements the interface objinterface.Collection.
func (*Collection) IDToTableName ¶ added in v0.50.0
func (pgf *Collection) IDToTableName(identifier id.Id) doltdb.TableName
IDToTableName implements the interface objinterface.Collection.
func (*Collection) IterAll ¶ added in v0.50.0
func (pgf *Collection) IterAll(ctx context.Context, callback func(rootObj objinterface.RootObject) (stop bool, err error)) error
IterAll implements the interface objinterface.Collection.
func (*Collection) IterIDs ¶ added in v0.50.0
func (pgf *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
IterIDs implements the interface objinterface.Collection.
func (*Collection) IterateFunctions ¶
func (pgf *Collection) IterateFunctions(ctx context.Context, callback func(f Function) (stop bool, err error)) error
IterateFunctions iterates over all functions in the collection.
func (*Collection) LoadCollection ¶ added in v0.50.0
func (*Collection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
LoadCollection implements the interface objinterface.Collection.
func (*Collection) PutRootObject ¶ added in v0.50.0
func (pgf *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
PutRootObject implements the interface objinterface.Collection.
func (*Collection) RenameRootObject ¶ added in v0.50.0
RenameRootObject implements the interface objinterface.Collection.
func (*Collection) ResolveName ¶ added in v0.50.0
func (pgf *Collection) ResolveName(ctx context.Context, name doltdb.TableName) (doltdb.TableName, id.Id, error)
ResolveName implements the interface objinterface.Collection.
func (*Collection) ResolveNameFromObjects ¶ added in v0.51.1
func (*Collection) ResolveNameFromObjects(ctx context.Context, name doltdb.TableName, rootObjects []objinterface.RootObject) (doltdb.TableName, id.Id, error)
ResolveNameFromObjects implements the interface objinterface.Collection.
func (*Collection) Serializer ¶ added in v0.50.0
func (*Collection) Serializer() objinterface.RootObjectSerializer
Serializer implements the interface objinterface.Collection.
func (*Collection) TableNameToID ¶ added in v0.50.0
func (pgf *Collection) TableNameToID(name doltdb.TableName) id.Id
TableNameToID implements the interface objinterface.Collection.
func (*Collection) UpdateField ¶ added in v0.51.1
func (pgf *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, newValue any) (objinterface.RootObject, error)
UpdateField implements the interface objinterface.Collection.
type Function ¶
type Function struct {
ID id.Function
ReturnType id.Type
AllParams []procedures.Parameter
Variadic bool
IsNonDeterministic bool
Strict bool
Definition string
ExtensionName string // Only used when this is an extension function
ExtensionSymbol string // Only used when this is an extension function
Operations []plpgsql.InterpreterOperation // Only used when this is a plpgsql language
SQLDefinition string // Only used when this is a sql language
SetOf bool
}
Function represents a created function.
func DeserializeFunction ¶ added in v0.50.0
DeserializeFunction returns the Function that was serialized in the byte slice. Returns an empty Function (invalid ID) if data is nil or empty.
func (Function) GetInnerDefinition ¶ added in v0.51.1
GetInnerDefinition returns the inner definition inside the CREATE FUNCTION statement.
func (Function) GetRootObjectID ¶ added in v0.51.1
func (function Function) GetRootObjectID() objinterface.RootObjectID
GetRootObjectID implements the interface objinterface.RootObject.
func (Function) ReplaceDefinition ¶ added in v0.51.1
ReplaceDefinition returns a new definition with the inner portion replaced with the given string.