Help us shape the future of Go! Take the 2026 Go Developer Survey

pgx

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package pgx implements xmigrator with native pgx v5 transactions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MetadataSchema, MetadataPrefix                    string
	RequireExistingMetadata                           bool
	DropSchemas                                       []string
	LockWaitTimeout, DDLLockTimeout, StatementTimeout time.Duration
}

type Driver

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

func FromConfig

func FromConfig(conn *pgx.ConnConfig, cfg Config) (*Driver, error)

func FromDSN

func FromDSN(dsn string, cfg Config) (*Driver, error)

func FromPool

func FromPool(pool *pgxpool.Pool, cfg Config) (*Driver, error)

FromPool preserves the application's dialer. Every run hijacks and physically closes one connection. The pool itself remains owned by the caller.

func (*Driver) ReadHistorySnapshot

func (d *Driver) ReadHistorySnapshot(ctx context.Context) (out []x.Record, err error)

func (*Driver) SQLDialect

func (*Driver) SQLDialect() string

func (*Driver) ValidateScript

func (d *Driver) ValidateScript(s x.Script) error

func (*Driver) WithSession

func (d *Driver) WithSession(ctx context.Context, fn func(x.Session[pgx.Tx]) error) (err error)

Jump to

Keyboard shortcuts

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