postgres

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.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 MockPQDatabase added in v0.3.8

type MockPQDatabase struct {
	mock.Mock
}

MockPQDatabase simulates the behavior of a real PQDatabase.

func (*MockPQDatabase) Close added in v0.3.8

func (m *MockPQDatabase) Close() error

func (*MockPQDatabase) GetEngineType added in v0.3.8

func (m *MockPQDatabase) GetEngineType() string

func (*MockPQDatabase) IsReady added in v0.3.8

func (m *MockPQDatabase) IsReady(ctx context.Context) (bool, error)

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

Jump to

Keyboard shortcuts

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