postgres

package
v0.0.0-alpha9 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Postgres)

Option - Option type

func ConnAttempts

func ConnAttempts(attempts int) Option

ConnAttempts - Returns connection attempts

func ConnTimeout

func ConnTimeout(timeout time.Duration) Option

ConnTimeout - Returns connection timeout

func MaxPoolSize

func MaxPoolSize(size int) Option

MaxPoolSize - Defines maximum pool size for postgresql db

type Postgres

type Postgres struct {
	Builder squirrel.StatementBuilderType
	Pool    *pgxpool.Pool
	// contains filtered or unexported fields
}

Postgres - Structure for Postresql instance

func New

func New(uri string, database string, opts ...Option) (*Postgres, error)

New - Creates new postgresql db instance

func (*Postgres) Close

func (p *Postgres) Close() error

Close - Close postgresql instance

func (*Postgres) GetEngineType

func (p *Postgres) GetEngineType() string

GetEngineType - Get the engine type which is postgresql in string

func (*Postgres) IsReady

func (p *Postgres) IsReady(ctx context.Context) (bool, error)

IsReady - Check whether postgresql instance is ready

func (*Postgres) Migrate

func (p *Postgres) Migrate(statements []string) (err error)

Migrate - Migration operations for postgresql db

Jump to

Keyboard shortcuts

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