Documentation
¶
Index ¶
- func OperatorIDToTableName(operatorID id.Operator) doltdb.TableName
- type Collection
- func (pgo *Collection) AddOperator(ctx context.Context, o Operator) error
- func (pgo *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
- func (pgo *Collection) DiffRootObjects(ctx context.Context, fromHash string, ours objinterface.RootObject, ...) ([]objinterface.RootObjectDiff, objinterface.RootObject, error)
- func (pgo *Collection) DropOperator(ctx context.Context, operatorIDs ...id.Operator) error
- func (pgo *Collection) DropRootObject(ctx context.Context, identifier id.Id) error
- func (pgo *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
- func (pgo *Collection) GetID() objinterface.RootObjectID
- func (pgo *Collection) GetOperator(ctx context.Context, operatorID id.Operator) (Operator, error)
- func (pgo *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 (pgo *Collection) HasOperator(ctx context.Context, operatorID id.Operator) bool
- func (pgo *Collection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)
- func (pgo *Collection) IDToTableName(identifier id.Id) doltdb.TableName
- func (pgo *Collection) IterAll(ctx context.Context, ...) error
- func (pgo *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
- func (pgo *Collection) IterateOperators(ctx context.Context, callback func(o Operator) (stop bool, err error)) error
- func (*Collection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
- func (pgo *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
- func (pgo *Collection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error
- func (pgo *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 (pgo *Collection) ResolveOperator(ctx context.Context, schemaNames []string, symbol string, leftType id.Type, ...) (Operator, bool, error)
- func (*Collection) Serializer() objinterface.RootObjectSerializer
- func (pgo *Collection) TableNameToID(name doltdb.TableName) id.Id
- func (pgo *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, ...) (objinterface.RootObject, error)
- type Operator
- func (operator Operator) GetID() id.Id
- func (operator Operator) GetRootObjectID() objinterface.RootObjectID
- func (operator Operator) HashOf(ctx context.Context) (hash.Hash, error)
- func (operator Operator) Name() doltdb.TableName
- func (operator Operator) Serialize(ctx context.Context) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collection ¶
type Collection struct {
objinterface.RootObjectMap
}
Collection contains a collection of operators.
func LoadOperators ¶
func LoadOperators(ctx context.Context, root objinterface.RootValue) (*Collection, error)
LoadOperators loads the operators collection from the given root.
func NewCollection ¶
func NewCollection(rom objinterface.RootObjectMap) *Collection
NewCollection returns a new Collection.
func (*Collection) AddOperator ¶
func (pgo *Collection) AddOperator(ctx context.Context, o Operator) error
AddOperator adds a new operator.
func (*Collection) DeserializeRootObject ¶
func (pgo *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
DeserializeRootObject implements the interface objinterface.Collection.
func (*Collection) DiffRootObjects ¶
func (pgo *Collection) DiffRootObjects(ctx context.Context, fromHash string, ours objinterface.RootObject, theirs objinterface.RootObject, ancestor objinterface.RootObject) ([]objinterface.RootObjectDiff, objinterface.RootObject, error)
DiffRootObjects implements the interface objinterface.Collection.
func (*Collection) DropOperator ¶
DropOperator drops an existing operator.
func (*Collection) DropRootObject ¶
DropRootObject implements the interface objinterface.Collection.
func (*Collection) GetFieldType ¶
func (pgo *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
GetFieldType implements the interface objinterface.Collection.
func (*Collection) GetID ¶
func (pgo *Collection) GetID() objinterface.RootObjectID
GetID implements the interface objinterface.Collection.
func (*Collection) GetOperator ¶
GetOperator returns the operator with the given ID. Returns an Operator with an invalid ID if it cannot be found (Operator.ID.IsValid() == false).
func (*Collection) GetRootObject ¶
func (pgo *Collection) GetRootObject(ctx context.Context, identifier id.Id) (objinterface.RootObject, bool, error)
GetRootObject implements the interface objinterface.Collection.
func (*Collection) HandleMerge ¶
func (*Collection) HandleMerge(ctx context.Context, mro merge.MergeRootObject) (doltdb.RootObject, *merge.MergeStats, error)
HandleMerge implements the interface objinterface.Collection.
func (*Collection) HasOperator ¶
HasOperator returns whether the given operator exists.
func (*Collection) HasRootObject ¶
HasRootObject implements the interface objinterface.Collection.
func (*Collection) IDToTableName ¶
func (pgo *Collection) IDToTableName(identifier id.Id) doltdb.TableName
IDToTableName implements the interface objinterface.Collection.
func (*Collection) IterAll ¶
func (pgo *Collection) IterAll(ctx context.Context, callback func(rootObj objinterface.RootObject) (stop bool, err error)) error
IterAll implements the interface objinterface.Collection.
func (*Collection) IterIDs ¶
func (pgo *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
IterIDs implements the interface objinterface.Collection.
func (*Collection) IterateOperators ¶
func (pgo *Collection) IterateOperators(ctx context.Context, callback func(o Operator) (stop bool, err error)) error
IterateOperators iterates over all operators in the collection.
func (*Collection) LoadCollection ¶
func (*Collection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
LoadCollection implements the interface objinterface.Collection.
func (*Collection) PutRootObject ¶
func (pgo *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
PutRootObject implements the interface objinterface.Collection.
func (*Collection) RenameRootObject ¶
RenameRootObject implements the interface objinterface.Collection.
func (*Collection) ResolveName ¶
func (pgo *Collection) ResolveName(ctx context.Context, name doltdb.TableName) (doltdb.TableName, id.Id, error)
ResolveName implements the interface objinterface.Collection.
func (*Collection) ResolveNameFromObjects ¶
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) ResolveOperator ¶
func (pgo *Collection) ResolveOperator(ctx context.Context, schemaNames []string, symbol string, leftType id.Type, rightType id.Type) (Operator, bool, error)
ResolveOperator returns the operator matching the given symbol and operand types, searching the given schemas in order and allowing unknown operand types to match any type. Returns false if no operator matches.
func (*Collection) Serializer ¶
func (*Collection) Serializer() objinterface.RootObjectSerializer
Serializer implements the interface objinterface.Collection.
func (*Collection) TableNameToID ¶
func (pgo *Collection) TableNameToID(name doltdb.TableName) id.Id
TableNameToID implements the interface objinterface.Collection.
func (*Collection) UpdateField ¶
func (pgo *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, newValue any) (objinterface.RootObject, error)
UpdateField implements the interface objinterface.Collection.
type Operator ¶
type Operator struct {
ID id.Operator
Function id.Function
ReturnType id.Type
Commutator string
Negator string
Hashes bool
Merges bool
}
Operator represents a user-defined operator.
func DeserializeOperator ¶
DeserializeOperator returns the Operator that was serialized in the byte slice. Returns an empty Operator (invalid ID) if data is nil or empty.
func (Operator) GetRootObjectID ¶
func (operator Operator) GetRootObjectID() objinterface.RootObjectID
GetRootObjectID implements the interface objinterface.RootObject.