extensions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	objinterface.RootObjectMap
	// 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, rom objinterface.RootObjectMap) (*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) 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

DiffRootObjects implements the interface objinterface.Collection.

func (*Collection) DropLoadedExtension

func (pge *Collection) DropLoadedExtension(ctx context.Context, names ...id.Extension) error

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

func (pge *Collection) DropRootObject(ctx context.Context, identifier id.Id) error

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

HandleMerge implements the interface objinterface.Collection.

func (*Collection) HasLoadedExtension

func (pge *Collection) HasLoadedExtension(ctx context.Context, name id.Extension) bool

HasLoadedExtension returns whether the extension has been loaded.

func (*Collection) HasRootObject

func (pge *Collection) HasRootObject(ctx context.Context, identifier id.Id) (bool, error)

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

LoadCollection implements the interface objinterface.Collection.

func (*Collection) PutRootObject

func (pge *Collection) PutRootObject(ctx context.Context, rootObj objinterface.RootObject) error

PutRootObject implements the interface objinterface.Collection.

func (*Collection) RenameRootObject

func (pge *Collection) RenameRootObject(ctx context.Context, oldName id.Id, newName id.Id) error

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

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.

type Extension

type Extension struct {
	ExtName     id.Extension
	Namespace   id.Namespace
	Relocatable bool
	Version     string
}

Extension represents an extension that has been installed into a database.

func DeserializeExtension

func DeserializeExtension(ctx context.Context, data []byte) (Extension, error)

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

func (ext Extension) CompareVersions(other Extension) int

CompareVersions compares the version of the extension versus the given extension, as opaque strings.

func (Extension) GetID

func (ext Extension) GetID() id.Id

GetID implements the interface objinterface.RootObject.

func (Extension) GetRootObjectID added in v0.51.1

func (ext Extension) GetRootObjectID() objinterface.RootObjectID

GetRootObjectID implements the interface objinterface.RootObject.

func (Extension) HashOf

func (ext Extension) HashOf(ctx context.Context) (hash.Hash, error)

HashOf implements the interface objinterface.RootObject.

func (Extension) Name

func (ext Extension) Name() doltdb.TableName

Name implements the interface objinterface.RootObject.

func (Extension) Serialize

func (ext Extension) Serialize(ctx context.Context) ([]byte, error)

Serialize returns the Extension as a byte slice. If the Extension is invalid (invalid ExtName), then this returns a nil slice.

Jump to

Keyboard shortcuts

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