Documentation
¶
Index ¶
- type TypeCollection
- func (pgs *TypeCollection) Clone(ctx context.Context) *TypeCollection
- func (pgs *TypeCollection) CreateType(ctx context.Context, typ *pgtypes.DoltgresType) error
- func (pgs *TypeCollection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
- func (pgs *TypeCollection) DiffRootObjects(ctx context.Context, fromHash string, ours objinterface.RootObject, ...) ([]objinterface.RootObjectDiff, objinterface.RootObject, error)
- func (pgs *TypeCollection) DropRootObject(ctx context.Context, identifier id.Id) error
- func (pgs *TypeCollection) DropType(ctx context.Context, names ...id.Type) (err error)
- func (pgs *TypeCollection) GetAllTypes(ctx context.Context) (typeMap map[string][]*pgtypes.DoltgresType, schemaNames []string, ...)
- func (pgs *TypeCollection) GetDomainType(ctx context.Context, name id.Type) (*pgtypes.DoltgresType, error)
- func (pgs *TypeCollection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
- func (pgs *TypeCollection) GetID() objinterface.RootObjectID
- func (pgs *TypeCollection) GetRootObject(ctx context.Context, identifier id.Id) (objinterface.RootObject, bool, error)
- func (pgs *TypeCollection) GetType(ctx context.Context, name id.Type) (*pgtypes.DoltgresType, error)
- func (*TypeCollection) HandleMerge(ctx context.Context, mro merge.MergeRootObject) (doltdb.RootObject, *merge.MergeStats, error)
- func (pgs *TypeCollection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)
- func (pgs *TypeCollection) HasType(ctx context.Context, name id.Type) bool
- func (pgs *TypeCollection) IDToTableName(identifier id.Id) doltdb.TableName
- func (pgs *TypeCollection) IterAll(ctx context.Context, ...) error
- func (pgs *TypeCollection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
- func (pgs *TypeCollection) IterateTypes(ctx context.Context, f func(typ *pgtypes.DoltgresType) (stop bool, err error)) error
- func (*TypeCollection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
- func (*TypeCollection) LoadCollectionHash(ctx context.Context, root objinterface.RootValue) (hash.Hash, error)
- func (pgs *TypeCollection) Map(ctx context.Context) (prolly.AddressMap, error)
- func (pgs *TypeCollection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
- func (pgs *TypeCollection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error
- func (pgs *TypeCollection) ResolveName(ctx context.Context, name doltdb.TableName) (doltdb.TableName, id.Id, error)
- func (*TypeCollection) ResolveNameFromObjects(ctx context.Context, name doltdb.TableName, ...) (doltdb.TableName, id.Id, error)
- func (*TypeCollection) Serializer() objinterface.RootObjectSerializer
- func (pgs *TypeCollection) TableNameToID(name doltdb.TableName) id.Id
- func (pgs *TypeCollection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, ...) (objinterface.RootObject, error)
- func (pgs *TypeCollection) UpdateRoot(ctx context.Context, root objinterface.RootValue) (objinterface.RootValue, error)
- type TypeWrapper
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
func (pgs *TypeCollection) 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 (*TypeCollection) DropRootObject ¶ added in v0.50.0
DropRootObject implements the interface objinterface.Collection.
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
func (pgs *TypeCollection) GetID() objinterface.RootObjectID
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
func (*TypeCollection) HandleMerge(ctx context.Context, mro merge.MergeRootObject) (doltdb.RootObject, *merge.MergeStats, error)
HandleMerge implements the interface objinterface.Collection.
func (*TypeCollection) HasRootObject ¶ added in v0.50.0
HasRootObject implements the interface objinterface.Collection.
func (*TypeCollection) HasType ¶ added in v0.16.0
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
func (*TypeCollection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
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
func (pgs *TypeCollection) Map(ctx context.Context) (prolly.AddressMap, error)
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
func (*TypeCollection) Serializer() objinterface.RootObjectSerializer
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
func (pgs *TypeCollection) UpdateRoot(ctx context.Context, root objinterface.RootValue) (objinterface.RootValue, error)
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
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.