postgres

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 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 MaxDataPerWrite added in v0.7.9

func MaxDataPerWrite(max int) Option

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

func MaxRetries added in v0.7.9

func MaxRetries(max int) Option

func WatchBufferSize added in v0.7.9

func WatchBufferSize(max int) Option

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) GetMaxDataPerWrite added in v0.7.9

func (p *Postgres) GetMaxDataPerWrite() int

func (*Postgres) GetMaxRetries added in v0.7.9

func (p *Postgres) GetMaxRetries() int

func (*Postgres) GetWatchBufferSize added in v0.7.9

func (p *Postgres) GetWatchBufferSize() int

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