postgres

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 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 ConnectionTimeout added in v0.2.0

func ConnectionTimeout(timeout time.Duration) Option

ConnectionTimeout - Returns connection timeout

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 {
	Builder squirrel.StatementBuilderType
	Pool    *pgxpool.Pool
	// contains filtered or unexported fields
}

Postgres - Structure for Postresql instance

func New

func New(uri, 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) 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