Documentation
¶
Index ¶
- type TypeCollection
- func (pgs *TypeCollection) Clone() *TypeCollection
- func (pgs *TypeCollection) CreateType(schName string, typ *types.DoltgresType) error
- func (pgs *TypeCollection) DropType(schName, typName string) error
- func (pgs *TypeCollection) GetAllTypes() (typesMap map[string][]*types.DoltgresType, schemaNames []string, ...)
- func (pgs *TypeCollection) GetDomainType(internalID id.Type) (*types.DoltgresType, bool)
- func (pgs *TypeCollection) GetType(internalID id.Type) (*types.DoltgresType, bool)
- func (pgs *TypeCollection) GetTypeByID(internalID id.Id) (*types.DoltgresType, bool)
- func (pgs *TypeCollection) HasType(schema string, typName string) bool
- func (pgs *TypeCollection) IterateTypes(f func(schema string, typ *types.DoltgresType) error) error
- func (pgs *TypeCollection) Serialize(ctx context.Context) ([]byte, error)
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 contains a collection of types.
func Deserialize ¶
func Deserialize(ctx context.Context, data []byte) (*TypeCollection, error)
Deserialize returns the Collection that was serialized in the byte slice. Returns an empty Collection if data is nil or empty.
func Merge ¶
func Merge(ctx context.Context, ourCollection, theirCollection, ancCollection *TypeCollection) (*TypeCollection, error)
Merge handles merging types on our root and their root.
func (*TypeCollection) Clone ¶
func (pgs *TypeCollection) Clone() *TypeCollection
Clone returns a new *TypeCollection with the same contents as the original.
func (*TypeCollection) CreateType ¶
func (pgs *TypeCollection) CreateType(schName string, typ *types.DoltgresType) error
CreateType creates a new type.
func (*TypeCollection) DropType ¶
func (pgs *TypeCollection) DropType(schName, typName string) error
DropType drops an existing type.
func (*TypeCollection) GetAllTypes ¶
func (pgs *TypeCollection) GetAllTypes() (typesMap map[string][]*types.DoltgresType, schemaNames []string, totalCount int)
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(internalID id.Type) (*types.DoltgresType, bool)
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) GetType ¶
func (pgs *TypeCollection) GetType(internalID id.Type) (*types.DoltgresType, bool)
GetType returns the type with the given schema and name. Returns nil if the type cannot be found.
func (*TypeCollection) GetTypeByID ¶ added in v0.16.0
func (pgs *TypeCollection) GetTypeByID(internalID id.Id) (*types.DoltgresType, bool)
GetTypeByID returns the type matching given ID.
func (*TypeCollection) HasType ¶ added in v0.16.0
func (pgs *TypeCollection) HasType(schema string, typName string) bool
HasType checks if a type exists with given schema and type name.
func (*TypeCollection) IterateTypes ¶
func (pgs *TypeCollection) IterateTypes(f func(schema string, typ *types.DoltgresType) error) error
IterateTypes iterates over all types in the collection.