v5

package
v0.0.0-...-9dc5ab1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: MIT Imports: 16 Imported by: 0

README

pgx v5

Pgx v5 driver support.

Url: pgx5://user:password@host:port/dbname?query

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultMigrationsTable       = "schema_migrations"
	DefaultMultiStatementMaxSize = 10 * 1 << 20 // 10 MB
)
View Source
var (
	ErrNilConfig      = fmt.Errorf("no config")
	ErrNoDatabaseName = fmt.Errorf("no database name")
	ErrNoSchema       = fmt.Errorf("no schema")
	ErrDatabaseDirty  = fmt.Errorf("database is dirty")
)

Functions

func WithInstance

func WithInstance(instance *sql.DB, config *Config) (database.Driver, error)

Types

type Config

type Config struct {
	MigrationsTable string
	DatabaseName    string
	SchemaName      string

	StatementTimeout      time.Duration
	MigrationsTableQuoted bool
	MultiStatementEnabled bool
	MultiStatementMaxSize int
	// contains filtered or unexported fields
}

type Postgres

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

func (*Postgres) Close

func (p *Postgres) Close() error

func (*Postgres) Drop

func (p *Postgres) Drop() (err error)

func (*Postgres) Open

func (p *Postgres) Open(url string) (database.Driver, error)

func (*Postgres) Run

func (p *Postgres) Run(migration io.Reader) error

func (*Postgres) SetVersion

func (p *Postgres) SetVersion(version int, dirty bool) error

func (*Postgres) Unlock

func (p *Postgres) Unlock() error

func (*Postgres) Version

func (p *Postgres) Version() (version int, dirty bool, err error)

Jump to

Keyboard shortcuts

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