Documentation
¶
Index ¶
- type Collection
- type RootObject
- type RootObjectID
- type RootObjectSerializer
- func (serializer RootObjectSerializer) CreateProllyMap(ctx context.Context, root RootValue) (prolly.AddressMap, error)
- func (serializer RootObjectSerializer) GetProllyMap(ctx context.Context, root RootValue) (prolly.AddressMap, bool, error)
- func (serializer RootObjectSerializer) WriteProllyMap(ctx context.Context, root RootValue, val prolly.AddressMap) (RootValue, error)
- type RootValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection interface {
// DropRootObject removes the given root object from the collection.
DropRootObject(ctx context.Context, identifier id.Id) error
// GetID returns the identifying ID for the Collection.
GetID() RootObjectID
// GetRootObject returns the root object matching the given ID. Returns false if it cannot be found.
GetRootObject(ctx context.Context, identifier id.Id) (RootObject, bool, error)
// HasRootObject returns whether a root object exactly matching the given ID was found.
HasRootObject(ctx context.Context, identifier id.Id) (bool, error)
// IDToTableName converts the given ID to a table name. The table name will be empty for invalid IDs.
IDToTableName(identifier id.Id) doltdb.TableName
// IterAll iterates over all root objects in the Collection.
IterAll(ctx context.Context, callback func(rootObj RootObject) (stop bool, err error)) error
// IterIDs iterates over all IDs in the Collection.
IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
// PutRootObject updates the Collection with the given root object. This may error if the root object already exists.
PutRootObject(ctx context.Context, rootObj RootObject) error
// RenameRootObject changes the ID for a root object matching the old ID.
RenameRootObject(ctx context.Context, oldID id.Id, newID id.Id) error
// ResolveName finds the closest matching (or exact) ID for the given name. If an exact match is not found, then
// this may error if the name is ambiguous.
ResolveName(ctx context.Context, name doltdb.TableName) (doltdb.TableName, id.Id, error)
// TableNameToID converts the given name to an ID. The ID will be invalid for empty/malformed names.
TableNameToID(name doltdb.TableName) id.Id
// HandleMerge handles merging of two objects. It is guaranteed that "ours" and "theirs" will not be nil, however
// "ancestor" may or may not be nil.
HandleMerge(ctx context.Context, mro merge.MergeRootObject) (doltdb.RootObject, *merge.MergeStats, error)
// LoadCollection loads the Collection from the given root.
LoadCollection(ctx context.Context, root RootValue) (Collection, error)
// LoadCollectionHash loads the Collection hash from the given root. This does not load the entire collection from
// the root, and is therefore a bit more performant if only the hash is needed.
LoadCollectionHash(ctx context.Context, root RootValue) (hash.Hash, error)
// Serializer returns the serializer associated with this Collection.
Serializer() RootObjectSerializer
// UpdateRoot updates the Collection in the given root, returning the updated root.
UpdateRoot(ctx context.Context, root RootValue) (RootValue, error)
}
Collection is a collection of root objects.
type RootObject ¶
type RootObject interface {
doltdb.RootObject
// GetID returns the ID associated with this root object.
GetID() RootObjectID
}
RootObject is an expanded interface on Dolt's root objects.
type RootObjectID ¶
type RootObjectID int64
RootObjectID is an ID that distinguishes names and root objects from one another.
const ( RootObjectID_None RootObjectID = iota RootObjectID_Sequences RootObjectID_Types RootObjectID_Functions RootObjectID_Triggers )
type RootObjectSerializer ¶
type RootObjectSerializer struct {
Bytes func(*serial.RootValue) []byte
RootValueAdd func(builder *flatbuffers.Builder, sequences flatbuffers.UOffsetT)
}
RootObjectSerializer holds function pointers for the serialization of root objects.
func (RootObjectSerializer) CreateProllyMap ¶
func (serializer RootObjectSerializer) CreateProllyMap(ctx context.Context, root RootValue) (prolly.AddressMap, error)
CreateProllyMap creates and returns a new, empty Prolly map.
func (RootObjectSerializer) GetProllyMap ¶
func (serializer RootObjectSerializer) GetProllyMap(ctx context.Context, root RootValue) (prolly.AddressMap, bool, error)
GetProllyMap loads the Prolly map from the given root, using the internal serialization functions.
func (RootObjectSerializer) WriteProllyMap ¶
func (serializer RootObjectSerializer) WriteProllyMap(ctx context.Context, root RootValue, val prolly.AddressMap) (RootValue, error)
WriteProllyMap writes the given Prolly map to the root, returning the updated root.
type RootValue ¶
type RootValue interface {
doltdb.RootValue
// GetStorage returns the storage contained in the root.
GetStorage(context.Context) storage.RootStorage
// WithStorage returns an updated RootValue with the given storage.
WithStorage(context.Context, storage.RootStorage) RootValue
}
RootValue is an interface to get around import cycles, since the core package references this package (and is where RootValue is defined).