Documentation
¶
Index ¶
- func GetExtension(name string) (_ *pg_extension.ExtensionFiles, err error)
- func GetExtensionFunction(identifier LibraryIdentifier, funcName string) (_ pg_extension.Function, err error)
- func GetPlatform() string
- type Collection
- func (pge *Collection) AddLoadedExtension(ctx context.Context, ext Extension) error
- func (pge *Collection) Clone(ctx context.Context) *Collection
- func (pge *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
- func (pge *Collection) DiffRootObjects(ctx context.Context, fromHash string, ours objinterface.RootObject, ...) ([]objinterface.RootObjectDiff, objinterface.RootObject, error)
- func (pge *Collection) DiffersFrom(ctx context.Context, root objinterface.RootValue) bool
- func (pge *Collection) DropLoadedExtension(ctx context.Context, names ...id.Extension) error
- func (pge *Collection) DropRootObject(ctx context.Context, identifier id.Id) error
- func (pge *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
- func (pge *Collection) GetID() objinterface.RootObjectID
- func (pge *Collection) GetLoadedExtension(ctx context.Context, name id.Extension) (Extension, error)
- func (pge *Collection) GetRootObject(ctx context.Context, identifier id.Id) (objinterface.RootObject, bool, error)
- func (*Collection) HandleMerge(ctx context.Context, mro merge.MergeRootObject) (doltdb.RootObject, *merge.MergeStats, error)
- func (pge *Collection) HasLoadedExtension(ctx context.Context, name id.Extension) bool
- func (pge *Collection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)
- func (pge *Collection) IDToTableName(identifier id.Id) doltdb.TableName
- func (pge *Collection) IterAll(ctx context.Context, ...) error
- func (pge *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
- func (*Collection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
- func (*Collection) LoadCollectionHash(ctx context.Context, root objinterface.RootValue) (hash.Hash, error)
- func (pge *Collection) Map(ctx context.Context) (prolly.AddressMap, error)
- func (pge *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
- func (pge *Collection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error
- func (pge *Collection) ResolveName(ctx context.Context, name doltdb.TableName) (doltdb.TableName, id.Id, error)
- func (*Collection) ResolveNameFromObjects(ctx context.Context, name doltdb.TableName, ...) (doltdb.TableName, id.Id, error)
- func (*Collection) Serializer() objinterface.RootObjectSerializer
- func (pge *Collection) TableNameToID(name doltdb.TableName) id.Id
- func (pge *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, ...) (objinterface.RootObject, error)
- func (pge *Collection) UpdateRoot(ctx context.Context, root objinterface.RootValue) (objinterface.RootValue, error)
- type Extension
- func (ext Extension) CompareVersions(other Extension) int
- func (ext Extension) GetID() id.Id
- func (ext Extension) GetRootObjectID() objinterface.RootObjectID
- func (ext Extension) HashOf(ctx context.Context) (hash.Hash, error)
- func (ext Extension) Name() doltdb.TableName
- func (ext Extension) Serialize(ctx context.Context) ([]byte, error)
- type InvalidIdentifier
- type InvalidIdentifierReason
- type LibraryIdentifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExtension ¶
func GetExtension(name string) (_ *pg_extension.ExtensionFiles, err error)
GetExtension returns the extension matching the given name. Returns an error if the extension cannot be found.
func GetExtensionFunction ¶
func GetExtensionFunction(identifier LibraryIdentifier, funcName string) (_ pg_extension.Function, err error)
GetExtensionFunction returns the function inside the extension matching the given names. Returns an error if the extension or function cannot be found.
func GetPlatform ¶
func GetPlatform() string
GetPlatform returns the current platform that Doltgres is being executed on. This is encoded as a three-letter string.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection contains a collection of loaded extensions.
func LoadExtensions ¶
func LoadExtensions(ctx context.Context, root objinterface.RootValue) (*Collection, error)
LoadExtensions loads the extensions collection from the given root.
func NewCollection ¶
func NewCollection(ctx context.Context, underlyingMap prolly.AddressMap, ns tree.NodeStore) (*Collection, error)
NewCollection returns a new Collection.
func (*Collection) AddLoadedExtension ¶
func (pge *Collection) AddLoadedExtension(ctx context.Context, ext Extension) error
AddLoadedExtension adds a new extension, that has already been loaded, to the collection.
func (*Collection) Clone ¶
func (pge *Collection) Clone(ctx context.Context) *Collection
Clone returns a new *Collection with the same contents as the original.
func (*Collection) DeserializeRootObject ¶ added in v0.51.1
func (pge *Collection) DeserializeRootObject(ctx context.Context, data []byte) (objinterface.RootObject, error)
DeserializeRootObject implements the interface objinterface.Collection.
func (*Collection) DiffRootObjects ¶ added in v0.51.1
func (pge *Collection) 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 (*Collection) DiffersFrom ¶
func (pge *Collection) DiffersFrom(ctx context.Context, root objinterface.RootValue) bool
DiffersFrom returns true when the hash that is associated with the underlying map for this collection is different from the hash in the given root.
func (*Collection) DropLoadedExtension ¶
DropLoadedExtension drops a loaded extension. This should be called when unloading an extension, but this function itself does not perform the necessary logic.
func (*Collection) DropRootObject ¶
DropRootObject implements the interface objinterface.Collection.
func (*Collection) GetFieldType ¶ added in v0.51.1
func (pge *Collection) GetFieldType(ctx context.Context, fieldName string) *pgtypes.DoltgresType
GetFieldType implements the interface objinterface.Collection.
func (*Collection) GetID ¶
func (pge *Collection) GetID() objinterface.RootObjectID
GetID implements the interface objinterface.Collection.
func (*Collection) GetLoadedExtension ¶
func (pge *Collection) GetLoadedExtension(ctx context.Context, name id.Extension) (Extension, error)
GetLoadedExtension returns the loaded extension with the given name. Returns an extension with an invalid ID if it cannot be found.
func (*Collection) GetRootObject ¶
func (pge *Collection) GetRootObject(ctx context.Context, identifier id.Id) (objinterface.RootObject, bool, error)
GetRootObject implements the interface objinterface.Collection.
func (*Collection) HandleMerge ¶
func (*Collection) HandleMerge(ctx context.Context, mro merge.MergeRootObject) (doltdb.RootObject, *merge.MergeStats, error)
HandleMerge implements the interface objinterface.Collection.
func (*Collection) HasLoadedExtension ¶
HasLoadedExtension returns whether the extension has been loaded.
func (*Collection) HasRootObject ¶
HasRootObject implements the interface objinterface.Collection.
func (*Collection) IDToTableName ¶
func (pge *Collection) IDToTableName(identifier id.Id) doltdb.TableName
IDToTableName implements the interface objinterface.Collection.
func (*Collection) IterAll ¶
func (pge *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 (pge *Collection) IterIDs(ctx context.Context, callback func(identifier id.Id) (stop bool, err error)) error
IterIDs implements the interface objinterface.Collection.
func (*Collection) LoadCollection ¶
func (*Collection) LoadCollection(ctx context.Context, root objinterface.RootValue) (objinterface.Collection, error)
LoadCollection implements the interface objinterface.Collection.
func (*Collection) LoadCollectionHash ¶
func (*Collection) LoadCollectionHash(ctx context.Context, root objinterface.RootValue) (hash.Hash, error)
LoadCollectionHash implements the interface objinterface.Collection.
func (*Collection) Map ¶
func (pge *Collection) Map(ctx context.Context) (prolly.AddressMap, error)
Map writes any cached sequences to the underlying map, and then returns the underlying map.
func (*Collection) PutRootObject ¶
func (pge *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error
PutRootObject implements the interface objinterface.Collection.
func (*Collection) RenameRootObject ¶
RenameRootObject implements the interface objinterface.Collection.
func (*Collection) ResolveName ¶
func (pge *Collection) ResolveName(ctx context.Context, name doltdb.TableName) (doltdb.TableName, id.Id, error)
ResolveName implements the interface objinterface.Collection.
func (*Collection) ResolveNameFromObjects ¶ added in v0.51.1
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 ¶
func (*Collection) Serializer() objinterface.RootObjectSerializer
Serializer implements the interface objinterface.Collection.
func (*Collection) TableNameToID ¶
func (pge *Collection) TableNameToID(name doltdb.TableName) id.Id
TableNameToID implements the interface objinterface.Collection.
func (*Collection) UpdateField ¶ added in v0.51.1
func (pge *Collection) UpdateField(ctx context.Context, rootObject objinterface.RootObject, fieldName string, newValue any) (objinterface.RootObject, error)
UpdateField implements the interface objinterface.Collection.
func (*Collection) UpdateRoot ¶
func (pge *Collection) UpdateRoot(ctx context.Context, root objinterface.RootValue) (objinterface.RootValue, error)
UpdateRoot implements the interface objinterface.Collection.
type Extension ¶
type Extension struct {
ExtName id.Extension
Namespace id.Namespace
Relocatable bool
LibIdentifier LibraryIdentifier
}
Extension represents a loaded extension.
func DeserializeExtension ¶
DeserializeExtension returns the Extension that was serialized in the byte slice. Returns an empty Extension (has an invalid ID) if data is nil or empty.
func (Extension) CompareVersions ¶
CompareVersions compares the major and minor version of the extension versus the given extension.
func (Extension) GetRootObjectID ¶ added in v0.51.1
func (ext Extension) GetRootObjectID() objinterface.RootObjectID
GetRootObjectID implements the interface objinterface.RootObject.
type InvalidIdentifier ¶
type InvalidIdentifier struct {
Identifier LibraryIdentifier
Reason InvalidIdentifierReason
}
InvalidIdentifier represents an invalid LibraryIdentifier, providing both the LibraryIdentifier and the reason that it is invalid.
func FindInvalidIdentifiers ¶
func FindInvalidIdentifiers(identifiers ...LibraryIdentifier) []InvalidIdentifier
FindInvalidIdentifiers returns all identifiers that are not valid for the current environment. If the return is empty, then that means all of the given identifiers are valid.
type InvalidIdentifierReason ¶
type InvalidIdentifierReason uint8
InvalidIdentifierReason gives a reason as to why an Identifier is invalid.
const ( InvalidIdentifierReason_MismatchedPlatform InvalidIdentifierReason = iota InvalidIdentifierReason_MissingLibrary InvalidIdentifierReason_InvalidVersion )
type LibraryIdentifier ¶
type LibraryIdentifier string
LibraryIdentifier points to a specific extension, as extension functions are dependent on the extension name, version, and originating platform (as different platforms may encode data differently).
func CreateLibraryIdentifier ¶
func CreateLibraryIdentifier(name string, version pg_extension.Version) LibraryIdentifier
CreateLibraryIdentifier creates a LibraryIdentifier using the given information.
func (LibraryIdentifier) DisplayString ¶
func (id LibraryIdentifier) DisplayString() string
DisplayString returns the identifier as a human-readable string.
func (LibraryIdentifier) ExtensionName ¶
func (id LibraryIdentifier) ExtensionName() string
ExtensionName returns the extension referenced by this LibraryIdentifier.
func (LibraryIdentifier) Platform ¶
func (id LibraryIdentifier) Platform() string
Platform returns the platform that this LibraryIdentifier was created on.
func (LibraryIdentifier) Version ¶
func (id LibraryIdentifier) Version() pg_extension.Version
Version returns the library version that this LibraryIdentifier references.