extensions

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extension

type Extension struct {
	Name        string  `json:"name"`        // Extension package name
	SQLName     string  `json:"sql_name"`    // SQL name used in CREATE EXTENSION
	Description string  `json:"description"` // Brief description
	Required    bool    `json:"required"`    // Whether this extension is required
	MinVersion  float32 `json:"min_version"` // Minimum PostgreSQL version required
	Available   bool    `json:"available"`   // Whether extension files are available
	Installed   bool    `json:"installed"`   // Whether extension is installed in database

	Install     func(p pkg.Postgres) error
	IsInstalled func(p pkg.Postgres) bool
	Health      func(p pkg.Postgres) error
}

Extension represents a PostgreSQL extension configuration

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry holds the extension registry

func GetDefaultRegistry

func GetDefaultRegistry() *Registry

GetDefaultRegistry returns the default extension registry with built-in extensions

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new extension registry

func (*Registry) Get

func (r *Registry) Get(name string) (*Extension, bool)

Get retrieves an extension by name

func (*Registry) GetBySQL

func (r *Registry) GetBySQL(sqlName string) (*Extension, bool)

GetBySQL retrieves an extension by its SQL name

func (*Registry) GetMissingExtensions

func (r *Registry) GetMissingExtensions(extensions []*Extension) []*Extension

GetMissingExtensions returns extensions that are required but not available

func (*Registry) GetRequiredExtensions

func (r *Registry) GetRequiredExtensions(extensions []*Extension) []*Extension

GetRequiredExtensions returns only the extensions marked as required

func (*Registry) GetUninstalledExtensions

func (r *Registry) GetUninstalledExtensions(extensions []*Extension) []*Extension

GetUninstalledExtensions returns extensions that are available but not installed

func (*Registry) List

func (r *Registry) List() []*Extension

List returns all registered extensions

func (*Registry) ParseFromEnvironment

func (r *Registry) ParseFromEnvironment() ([]*Extension, error)

ParseFromEnvironment parses the POSTGRES_EXTENSIONS environment variable and returns a list of extensions with their status updated

func (*Registry) Register

func (r *Registry) Register(ext *Extension)

Register adds an extension to the registry

func (*Registry) ValidatePostgreSQLVersion

func (r *Registry) ValidatePostgreSQLVersion(extensions []*Extension, pgVersion float32) []string

ValidatePostgreSQLVersion checks if extensions are compatible with PostgreSQL version

Jump to

Keyboard shortcuts

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