aggregates

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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

func DeserializeAggregate(ctx context.Context, data []byte) (Aggregate, error)

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) GetID

func (aggregate Aggregate) GetID() id.Id

GetID implements the interface objinterface.RootObject.

func (Aggregate) GetRootObjectID

func (aggregate Aggregate) GetRootObjectID() objinterface.RootObjectID

GetRootObjectID implements the interface objinterface.RootObject.

func (Aggregate) HashOf

func (aggregate Aggregate) HashOf(ctx context.Context) (hash.Hash, error)

HashOf implements the interface objinterface.RootObject.

func (Aggregate) Name

func (aggregate Aggregate) Name() doltdb.TableName

Name implements the interface objinterface.RootObject.

func (Aggregate) Serialize

func (aggregate Aggregate) Serialize(ctx context.Context) ([]byte, error)

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

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

DiffRootObjects implements the interface objinterface.Collection.

func (*Collection) DropAggregate

func (pga *Collection) DropAggregate(ctx context.Context, aggregateIDs ...id.Function) error

DropAggregate drops an existing aggregate.

func (*Collection) DropRootObject

func (pga *Collection) DropRootObject(ctx context.Context, identifier id.Id) error

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

HandleMerge implements the interface objinterface.Collection.

func (*Collection) HasAggregate

func (pga *Collection) HasAggregate(ctx context.Context, aggregateID id.Function) bool

HasAggregate returns whether the given aggregate exists.

func (*Collection) HasAggregateName

func (pga *Collection) HasAggregateName(ctx context.Context, name string) (bool, error)

HasAggregateName returns whether an aggregate with the given name exists in any schema.

func (*Collection) HasRootObject

func (pga *Collection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)

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

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

func (pga *Collection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error

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

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.

Jump to

Keyboard shortcuts

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