postgres

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: AGPL-3.0 Imports: 8 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 MaxConnectionIdleTime added in v0.2.3

func MaxConnectionIdleTime(d time.Duration) Option

MaxConnectionIdleTime - Defines maximum connection idle for postgresql db

func MaxConnectionLifeTime added in v0.2.3

func MaxConnectionLifeTime(d time.Duration) Option

MaxConnectionLifeTime - Defines maximum connection lifetime for postgresql db

func MaxIdleConnections added in v0.2.3

func MaxIdleConnections(c int) Option

MaxIdleConnections - Defines maximum idle connections for postgresql db

func MaxOpenConnections added in v0.2.0

func MaxOpenConnections(size int) Option

MaxOpenConnections - Defines maximum open connections for postgresql db

type Postgres

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

Postgres - Structure for Postresql instance

func New

func New(uri 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 if database 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