Documentation
¶
Index ¶
- Constants
- func ProcedureIDToTableName(procID id.Procedure) doltdb.TableName
- type Collection
- func (pgp *Collection) AddProcedure(ctx context.Context, proc Procedure) error
- func (pgp *Collection) Clone(_ context.Context) *Collection
- func (pgp *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
- func (pgp *Collection) DiffRootObjects(ctx context.Context, fromHash string, o objinterface.RootObject, ...) ([]objinterface.RootObjectDiff, objinterface.RootObject, error)
- func (pgp *Collection) DiffersFrom(ctx context.Context, root objinterface.RootValue) bool
- func (pgp *Collection) DropProcedure(ctx context.Context, procIDs ...id.Procedure) error
- func (pgp *Collection) DropRootObject(ctx context.Context, identifier id.Id) error
- func (pgp *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
- func (pgp *Collection) GetID() objinterface.RootObjectID
- func (pgp *Collection) GetProcedure(_ context.Context, procID id.Procedure) (Procedure, error)
- func (pgp *Collection) GetProcedureOverloads(_ context.Context, procID id.Procedure) ([]Procedure, error)
- func (pgp *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 (pgp *Collection) HasProcedure(_ context.Context, procID id.Procedure) bool
- func (pgp *Collection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)
- func (pgp *Collection) IDToTableName(identifier id.Id) doltdb.TableName
- func (pgp *Collection) IterAll(ctx context.Context, ...) error
- func (pgp *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
- func (pgp *Collection) IterateProcedures(_ context.Context, callback func(f Procedure) (stop bool, err error)) error
- func (*Collection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
- func (*Collection) LoadCollectionHash(ctx context.Context, root objinterface.RootValue) (hash.Hash, error)
- func (pgp *Collection) Map(_ context.Context) (prolly.AddressMap, error)
- func (pgp *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
- func (pgp *Collection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error
- func (pgp *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 (pgp *Collection) TableNameToID(name doltdb.TableName) id.Id
- func (pgp *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, ...) (objinterface.RootObject, error)
- func (pgp *Collection) UpdateRoot(ctx context.Context, root objinterface.RootValue) (objinterface.RootValue, error)
- type ParameterMode
- type Procedure
- func (procedure Procedure) GetID() id.Id
- func (procedure Procedure) GetInnerDefinition() string
- func (procedure Procedure) GetRootObjectID() objinterface.RootObjectID
- func (procedure Procedure) HashOf(ctx context.Context) (hash.Hash, error)
- func (procedure Procedure) Name() doltdb.TableName
- func (procedure Procedure) ParameterModesAsString() string
- func (procedure Procedure) ReplaceDefinition(newInner string) string
- func (procedure Procedure) Serialize(ctx context.Context) ([]byte, error)
Constants ¶
const ( FIELD_NAME_PARAMETER_NAMES = "parameter_names" FIELD_NAME_PARAMETER_MODES = "parameter_argmodes" FIELD_NAME_DEFINITION = "definition" FIELD_NAME_EXTENSION_NAME = "extension_name" FIELD_NAME_EXTENSION_SYMBOL = "extension_symbol" FIELD_NAME_SQL_DEFINITION = "sql_definition" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collection ¶ added in v0.52.3
type Collection struct {
// contains filtered or unexported fields
}
Collection contains a collection of procedures.
func LoadProcedures ¶ added in v0.52.3
func LoadProcedures(ctx context.Context, root objinterface.RootValue) (*Collection, error)
LoadProcedures loads the procedures collection from the given root.
func NewCollection ¶ added in v0.52.3
func NewCollection(ctx context.Context, underlyingMap prolly.AddressMap, ns tree.NodeStore) (*Collection, error)
NewCollection returns a new Collection.
func (*Collection) AddProcedure ¶ added in v0.52.3
func (pgp *Collection) AddProcedure(ctx context.Context, proc Procedure) error
AddProcedure adds a new procedure.
func (*Collection) Clone ¶ added in v0.52.3
func (pgp *Collection) Clone(_ context.Context) *Collection
Clone returns a new *Collection with the same contents as the original.
func (*Collection) DeserializeRootObject ¶ added in v0.52.3
func (pgp *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
DeserializeRootObject implements the interface objinterface.Collection.
func (*Collection) DiffRootObjects ¶ added in v0.52.3
func (pgp *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) DiffersFrom ¶ added in v0.52.3
func (pgp *Collection) DiffersFrom(ctx context.Context, root objinterface.RootValue) bool
DiffersFrom returns true when the hash that is associated with the underlying map for this collection is different from the hash in the given root.
func (*Collection) DropProcedure ¶ added in v0.52.3
DropProcedure drops an existing procedure.
func (*Collection) DropRootObject ¶ added in v0.52.3
DropRootObject implements the interface objinterface.Collection.
func (*Collection) GetFieldType ¶ added in v0.52.3
func (pgp *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
GetFieldType implements the interface objinterface.Collection.
func (*Collection) GetID ¶ added in v0.52.3
func (pgp *Collection) GetID() objinterface.RootObjectID
GetID implements the interface objinterface.Collection.
func (*Collection) GetProcedure ¶ added in v0.52.3
GetProcedure returns the procedure with the given ID. Returns a procedure with an invalid ID if it cannot be found (Procedure.ID.IsValid() == false).
func (*Collection) GetProcedureOverloads ¶ added in v0.52.3
func (pgp *Collection) GetProcedureOverloads(_ context.Context, procID id.Procedure) ([]Procedure, error)
GetProcedureOverloads returns the overloads for the procedure matching the schema and the procedure name. The parameter types are ignored when searching for overloads.
func (*Collection) GetRootObject ¶ added in v0.52.3
func (pgp *Collection) GetRootObject(ctx context.Context, identifier id.Id) (objinterface.RootObject, bool, error)
GetRootObject implements the interface objinterface.Collection.
func (*Collection) HandleMerge ¶ added in v0.52.3
func (*Collection) HandleMerge(ctx context.Context, mro merge.MergeRootObject) (doltdb.RootObject, *merge.MergeStats, error)
HandleMerge implements the interface objinterface.Collection.
func (*Collection) HasProcedure ¶ added in v0.52.3
HasProcedure returns whether the procedure is present.
func (*Collection) HasRootObject ¶ added in v0.52.3
HasRootObject implements the interface objinterface.Collection.
func (*Collection) IDToTableName ¶ added in v0.52.3
func (pgp *Collection) IDToTableName(identifier id.Id) doltdb.TableName
IDToTableName implements the interface objinterface.Collection.
func (*Collection) IterAll ¶ added in v0.52.3
func (pgp *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.52.3
func (pgp *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
IterIDs implements the interface objinterface.Collection.
func (*Collection) IterateProcedures ¶ added in v0.52.3
func (pgp *Collection) IterateProcedures(_ context.Context, callback func(f Procedure) (stop bool, err error)) error
IterateProcedures iterates over all procedures in the collection.
func (*Collection) LoadCollection ¶ added in v0.52.3
func (*Collection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
LoadCollection implements the interface objinterface.Collection.
func (*Collection) LoadCollectionHash ¶ added in v0.52.3
func (*Collection) LoadCollectionHash(ctx context.Context, root objinterface.RootValue) (hash.Hash, error)
LoadCollectionHash implements the interface objinterface.Collection.
func (*Collection) Map ¶ added in v0.52.3
func (pgp *Collection) Map(_ context.Context) (prolly.AddressMap, error)
Map returns the underlying map.
func (*Collection) PutRootObject ¶ added in v0.52.3
func (pgp *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
PutRootObject implements the interface objinterface.Collection.
func (*Collection) RenameRootObject ¶ added in v0.52.3
RenameRootObject implements the interface objinterface.Collection.
func (*Collection) ResolveName ¶ added in v0.52.3
func (pgp *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.52.3
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.52.3
func (*Collection) Serializer() objinterface.RootObjectSerializer
Serializer implements the interface objinterface.Collection.
func (*Collection) TableNameToID ¶ added in v0.52.3
func (pgp *Collection) TableNameToID(name doltdb.TableName) id.Id
TableNameToID implements the interface objinterface.Collection.
func (*Collection) UpdateField ¶ added in v0.52.3
func (pgp *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, newValue any) (objinterface.RootObject, error)
UpdateField implements the interface objinterface.Collection.
func (*Collection) UpdateRoot ¶ added in v0.52.3
func (pgp *Collection) UpdateRoot(ctx context.Context, root objinterface.RootValue) (objinterface.RootValue, error)
UpdateRoot implements the interface objinterface.Collection.
type ParameterMode ¶ added in v0.52.3
type ParameterMode uint8
ParameterMode represents the mode of the given parameter (whether it's IN, OUT, INOUT, or VARIADIC).
const ( ParameterMode_IN ParameterMode = 0 ParameterMode_OUT ParameterMode = 1 ParameterMode_INOUT ParameterMode = 2 ParameterMode_VARIADIC ParameterMode = 3 )
func ParameterModesFromString ¶ added in v0.52.3
func ParameterModesFromString(str string) ([]ParameterMode, error)
ParameterModesFromString returns a ParameterMode slice from the given string. It is assumed that this string was originally created using Procedure.ParameterModesAsString.
type Procedure ¶ added in v0.52.3
type Procedure struct {
ID id.Procedure
ParameterNames []string
ParameterTypes []id.Type
ParameterModes []ParameterMode
Definition string
ExtensionName string // Only used when this is an extension procedure
ExtensionSymbol string // Only used when this is an extension procedure
Operations []plpgsql.InterpreterOperation // Only used when this is a plpgsql language
SQLDefinition string // Only used when this is a sql language
}
Procedure represents a created procedure.
func DeserializeProcedure ¶ added in v0.52.3
DeserializeProcedure returns the Procedure that was serialized in the byte slice. Returns an empty Procedure (invalid ID) if data is nil or empty.
func (Procedure) GetInnerDefinition ¶ added in v0.52.3
GetInnerDefinition returns the inner definition inside the CREATE PROCEDURE statement.
func (Procedure) GetRootObjectID ¶ added in v0.52.3
func (procedure Procedure) GetRootObjectID() objinterface.RootObjectID
GetRootObjectID implements the interface objinterface.RootObject.
func (Procedure) ParameterModesAsString ¶ added in v0.52.3
ParameterModesAsString returns a string that represents the parameter modes. The string may be converted back to a slice using ParameterModesFromString.
func (Procedure) ReplaceDefinition ¶ added in v0.52.3
ReplaceDefinition returns a new definition with the inner portion replaced with the given string.