postgresql

package
v0.0.0-...-4bc1af1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend implements the Backend interface for PostgreSQL

func NewBackend

func NewBackend() *Backend

NewBackend creates a new PostgreSQL backend

func (*Backend) Close

func (b *Backend) Close() error

Close closes the PostgreSQL connection

func (*Backend) Connect

func (b *Backend) Connect(config *backends.ConnectionConfig) error

Connect establishes a connection to PostgreSQL

func (*Backend) CreateSchema

func (b *Backend) CreateSchema(ctx context.Context, schemaName string) error

CreateSchema creates a schema if it doesn't exist

func (*Backend) ExecuteMigration

func (b *Backend) ExecuteMigration(ctx context.Context, migration *backends.MigrationScript) error

ExecuteMigration executes a migration script

func (*Backend) HealthCheck

func (b *Backend) HealthCheck(ctx context.Context) error

HealthCheck verifies the backend is accessible

func (*Backend) Name

func (b *Backend) Name() string

Name returns the backend name

func (*Backend) SchemaExists

func (b *Backend) SchemaExists(ctx context.Context, schemaName string) (bool, error)

SchemaExists checks if a schema exists

func (*Backend) TableExists

func (b *Backend) TableExists(ctx context.Context, schemaName, tableName string) (bool, error)

TableExists checks if a table exists in a schema

type DependencyValidator

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

DependencyValidator validates migration dependencies

func NewDependencyValidator

func NewDependencyValidator(backend *Backend, tracker state.StateTracker, reg registry.Registry) *DependencyValidator

NewDependencyValidator creates a new dependency validator

func (*DependencyValidator) ValidateDependencies

func (v *DependencyValidator) ValidateDependencies(ctx context.Context, migration *backends.MigrationScript, schemaName string) []error

ValidateDependencies validates all dependencies for a migration

func (*DependencyValidator) ValidateDependenciesWithExecutionSet

func (v *DependencyValidator) ValidateDependenciesWithExecutionSet(ctx context.Context, migration *backends.MigrationScript, schemaName string, executionSet []*backends.MigrationScript) []error

ValidateDependenciesWithExecutionSet validates all dependencies for a migration, considering migrations in the execution set as satisfied dependencies

Jump to

Keyboard shortcuts

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