Documentation
¶
Index ¶
- type Aggregate
- func (aggregate Aggregate) GetID() id.Id
- func (aggregate Aggregate) GetRootObjectID() objinterface.RootObjectID
- func (aggregate Aggregate) HashOf(ctx context.Context) (hash.Hash, error)
- func (aggregate Aggregate) Name() doltdb.TableName
- func (aggregate Aggregate) Serialize(ctx context.Context) ([]byte, error)
- type Collection
- func (pga *Collection) AddAggregate(ctx context.Context, a Aggregate) error
- func (pga *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
- func (pga *Collection) DiffRootObjects(ctx context.Context, fromHash string, ours objinterface.RootObject, ...) ([]objinterface.RootObjectDiff, objinterface.RootObject, error)
- func (pga *Collection) DropAggregate(ctx context.Context, aggregateIDs ...id.Function) error
- func (pga *Collection) DropRootObject(ctx context.Context, identifier id.Id) error
- func (pga *Collection) GetAggregate(ctx context.Context, aggregateID id.Function) (Aggregate, error)
- func (pga *Collection) GetAggregateOverloads(ctx context.Context, aggregateID id.Function) ([]Aggregate, error)
- func (pga *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
- func (pga *Collection) GetID() objinterface.RootObjectID
- func (pga *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 (pga *Collection) HasAggregate(ctx context.Context, aggregateID id.Function) bool
- func (pga *Collection) HasAggregateName(ctx context.Context, name string) (bool, error)
- func (pga *Collection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)
- func (pga *Collection) IDToTableName(identifier id.Id) doltdb.TableName
- func (pga *Collection) IterAll(ctx context.Context, ...) error
- func (pga *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
- func (pga *Collection) IterateAggregates(ctx context.Context, callback func(a Aggregate) (stop bool, err error)) error
- func (*Collection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
- func (pga *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
- func (pga *Collection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error
- func (pga *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 (pga *Collection) TableNameToID(name doltdb.TableName) id.Id
- func (pga *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, ...) (objinterface.RootObject, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregate ¶
type Aggregate struct {
ID id.Function
ReturnType id.Type
SFunc id.Function // State transition function
SType id.Type // Internal state type
FinalFunc id.Function // Final calculation function
CombineFunc id.Function
InitCond string
HasInitCond bool
}
Aggregate represents a created aggregate function.
func DeserializeAggregate ¶
DeserializeAggregate returns the Aggregate that was serialized in the byte slice. Returns an empty Aggregate (invalid ID) if data is nil or empty.
func (Aggregate) GetRootObjectID ¶
func (aggregate Aggregate) GetRootObjectID() objinterface.RootObjectID
GetRootObjectID implements the interface objinterface.RootObject.
type Collection ¶
type Collection struct {
objinterface.RootObjectMap
}
Collection contains a collection of aggregate functions.
func LoadAggregates ¶
func LoadAggregates(ctx context.Context, root objinterface.RootValue) (*Collection, error)
LoadAggregates loads the aggregates collection from the given root.
func NewCollection ¶
func NewCollection(ctx context.Context, rom objinterface.RootObjectMap) *Collection
NewCollection returns a new Collection.
func (*Collection) AddAggregate ¶
func (pga *Collection) AddAggregate(ctx context.Context, a Aggregate) error
AddAggregate adds a new aggregate.
func (*Collection) DeserializeRootObject ¶
func (pga *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
DeserializeRootObject implements the interface objinterface.Collection.
func (*Collection) DiffRootObjects ¶
func (pga *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) DropAggregate ¶
DropAggregate drops an existing aggregate.
func (*Collection) DropRootObject ¶
DropRootObject implements the interface objinterface.Collection.
func (*Collection) GetAggregate ¶
func (pga *Collection) GetAggregate(ctx context.Context, aggregateID id.Function) (Aggregate, error)
GetAggregate returns the aggregate with the given ID. Returns an Aggregate with an invalid ID if it cannot be found (Aggregate.ID.IsValid() == false).
func (*Collection) GetAggregateOverloads ¶
func (pga *Collection) GetAggregateOverloads(ctx context.Context, aggregateID id.Function) ([]Aggregate, error)
GetAggregateOverloads returns every aggregate that shares the given aggregate's schema and name.
func (*Collection) GetFieldType ¶
func (pga *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
GetFieldType implements the interface objinterface.Collection.
func (*Collection) GetID ¶
func (pga *Collection) GetID() objinterface.RootObjectID
GetID implements the interface objinterface.Collection.
func (*Collection) GetRootObject ¶
func (pga *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) HasAggregate ¶
HasAggregate returns whether the given aggregate exists.
func (*Collection) HasAggregateName ¶
HasAggregateName returns whether an aggregate with the given name exists in any schema.
func (*Collection) HasRootObject ¶
HasRootObject implements the interface objinterface.Collection.
func (*Collection) IDToTableName ¶
func (pga *Collection) IDToTableName(identifier id.Id) doltdb.TableName
IDToTableName implements the interface objinterface.Collection.
func (*Collection) IterAll ¶
func (pga *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 (pga *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
IterIDs implements the interface objinterface.Collection.
func (*Collection) IterateAggregates ¶
func (pga *Collection) IterateAggregates(ctx context.Context, callback func(a Aggregate) (stop bool, err error)) error
IterateAggregates iterates over all aggregates 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 (pga *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 (pga *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) Serializer ¶
func (*Collection) Serializer() objinterface.RootObjectSerializer
Serializer implements the interface objinterface.Collection.
func (*Collection) TableNameToID ¶
func (pga *Collection) TableNameToID(name doltdb.TableName) id.Id
TableNameToID implements the interface objinterface.Collection.
func (*Collection) UpdateField ¶
func (pga *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, newValue any) (objinterface.RootObject, error)
UpdateField implements the interface objinterface.Collection.