typecollection

package
v0.52.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TypeCollection

type TypeCollection struct {
	// contains filtered or unexported fields
}

TypeCollection is a collection of all types (both built-in and user defined).

func LoadTypes added in v0.50.0

func LoadTypes(ctx context.Context, root objinterface.RootValue) (*TypeCollection, error)

LoadTypes loads the types collection from the given root.

func (*TypeCollection) Clone

func (pgs *TypeCollection) Clone(ctx context.Context) *TypeCollection

Clone returns a new *TypeCollection with the same contents as the original.

func (*TypeCollection) CreateType

func (pgs *TypeCollection) CreateType(ctx context.Context, typ *pgtypes.DoltgresType) error

CreateType creates a new type.

func (*TypeCollection) DeserializeRootObject added in v0.51.1

func (pgs *TypeCollection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)

DeserializeRootObject implements the interface objinterface.Collection.

func (*TypeCollection) DiffRootObjects added in v0.51.1

DiffRootObjects implements the interface objinterface.Collection.

func (*TypeCollection) DropRootObject added in v0.50.0

func (pgs *TypeCollection) DropRootObject(ctx context.Context, identifier id.Id) error

DropRootObject implements the interface objinterface.Collection.

func (*TypeCollection) DropType

func (pgs *TypeCollection) DropType(ctx context.Context, names ...id.Type) (err error)

DropType drops an existing type.

func (*TypeCollection) GetAllTypes

func (pgs *TypeCollection) GetAllTypes(ctx context.Context) (typeMap map[string][]*pgtypes.DoltgresType, schemaNames []string, totalCount int, err error)

GetAllTypes returns a map containing all types in the collection, grouped by the schema they're contained in. Each type array is also sorted by the type name. It includes built-in types.

func (*TypeCollection) GetDomainType

func (pgs *TypeCollection) GetDomainType(ctx context.Context, name id.Type) (*pgtypes.DoltgresType, error)

GetDomainType returns a domain type with the given schema and name. Returns nil if the type cannot be found. It checks for domain type.

func (*TypeCollection) GetFieldType added in v0.51.1

func (pgs *TypeCollection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType

GetFieldType implements the interface objinterface.Collection.

func (*TypeCollection) GetID added in v0.50.0

GetID implements the interface objinterface.Collection.

func (*TypeCollection) GetRootObject added in v0.50.0

func (pgs *TypeCollection) GetRootObject(ctx context.Context, identifier id.Id) (objinterface.RootObject, bool, error)

GetRootObject implements the interface objinterface.Collection.

func (*TypeCollection) GetType

func (pgs *TypeCollection) GetType(ctx context.Context, name id.Type) (*pgtypes.DoltgresType, error)

GetType returns the type with the given schema and name. Returns nil if the type cannot be found.

func (*TypeCollection) HandleMerge added in v0.50.0

HandleMerge implements the interface objinterface.Collection.

func (*TypeCollection) HasRootObject added in v0.50.0

func (pgs *TypeCollection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)

HasRootObject implements the interface objinterface.Collection.

func (*TypeCollection) HasType added in v0.16.0

func (pgs *TypeCollection) HasType(ctx context.Context, name id.Type) bool

HasType checks if a type exists with given schema and type name.

func (*TypeCollection) IDToTableName added in v0.50.0

func (pgs *TypeCollection) IDToTableName(identifier id.Id) doltdb.TableName

IDToTableName implements the interface objinterface.Collection.

func (*TypeCollection) IterAll added in v0.50.0

func (pgs *TypeCollection) IterAll(ctx context.Context, callback func(rootObj objinterface.RootObject) (stop bool, err error)) error

IterAll implements the interface objinterface.Collection. As this is specifically used in the root object context, we do not iterate built-in types. In all other situations, we should use IterateTypes.

func (*TypeCollection) IterIDs added in v0.50.0

func (pgs *TypeCollection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error

IterIDs implements the interface objinterface.Collection. As this is specifically used in the root object context, we do not iterate the IDs of built-in types. In all other situations, we should use IterateTypes (even if you only need the IDs).

func (*TypeCollection) IterateTypes

func (pgs *TypeCollection) IterateTypes(ctx context.Context, f func(typ *pgtypes.DoltgresType) (stop bool, err error)) error

IterateTypes iterates over all types in the collection.

func (*TypeCollection) LoadCollection added in v0.50.0

LoadCollection implements the interface objinterface.Collection.

func (*TypeCollection) LoadCollectionHash added in v0.50.0

func (*TypeCollection) LoadCollectionHash(ctx context.Context, root objinterface.RootValue) (hash.Hash, error)

LoadCollectionHash implements the interface objinterface.Collection.

func (*TypeCollection) Map added in v0.50.0

Map writes any cached types to the underlying map, and then returns the underlying map.

func (*TypeCollection) PutRootObject added in v0.50.0

func (pgs *TypeCollection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error

PutRootObject implements the interface objinterface.Collection.

func (*TypeCollection) RenameRootObject added in v0.50.0

func (pgs *TypeCollection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error

RenameRootObject implements the interface objinterface.Collection.

func (*TypeCollection) ResolveName added in v0.50.0

func (pgs *TypeCollection) ResolveName(ctx context.Context, name doltdb.TableName) (doltdb.TableName, id.Id, error)

ResolveName implements the interface objinterface.Collection.

func (*TypeCollection) ResolveNameFromObjects added in v0.51.1

func (*TypeCollection) ResolveNameFromObjects(ctx context.Context, name doltdb.TableName, rootObjects []objinterface.RootObject) (doltdb.TableName, id.Id, error)

ResolveNameFromObjects implements the interface objinterface.Collection.

func (*TypeCollection) Serializer added in v0.50.0

Serializer implements the interface objinterface.Collection.

func (*TypeCollection) TableNameToID added in v0.50.0

func (pgs *TypeCollection) TableNameToID(name doltdb.TableName) id.Id

TableNameToID implements the interface objinterface.Collection.

func (*TypeCollection) UpdateField added in v0.51.1

func (pgs *TypeCollection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, newValue any) (objinterface.RootObject, error)

UpdateField implements the interface objinterface.Collection.

func (*TypeCollection) UpdateRoot added in v0.50.0

UpdateRoot implements the interface objinterface.Collection.

type TypeWrapper added in v0.50.0

type TypeWrapper struct {
	Type *pgtypes.DoltgresType
}

TypeWrapper is a wrapper around a type that allows it to be used as a root object.

func (TypeWrapper) GetID added in v0.50.0

func (t TypeWrapper) GetID() id.Id

GetID implements the interface objinterface.RootObject.

func (TypeWrapper) GetRootObjectID added in v0.51.1

func (t TypeWrapper) GetRootObjectID() objinterface.RootObjectID

GetRootObjectID implements the interface objinterface.RootObject.

func (TypeWrapper) HashOf added in v0.50.0

func (t TypeWrapper) HashOf(ctx context.Context) (hash.Hash, error)

HashOf implements the interface objinterface.RootObject.

func (TypeWrapper) Name added in v0.50.0

func (t TypeWrapper) Name() doltdb.TableName

Name implements the interface objinterface.RootObject.

func (TypeWrapper) Serialize added in v0.51.1

func (t TypeWrapper) Serialize(ctx context.Context) ([]byte, error)

Serialize implements the interface objinterface.RootObject.

Jump to

Keyboard shortcuts

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