postgres

package
v1.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	DisableSSL bool
	Host       string
	Port       int
	Database   string
	Username   string
	Password   string
}

Options for Postgres.

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}

Postgres is a wrapper around DB pool to Postgres.

func New

func New(o Options) (*Postgres, error)

New instantiates a new Postgres instance.

func (*Postgres) GetCurrentNumLocks

func (p *Postgres) GetCurrentNumLocks(ctx context.Context) (int, error)

GetCurrentNumLocks returns the number of locks currently held by the db.

func (*Postgres) GetPGTables

func (p *Postgres) GetPGTables(ctx context.Context, relations []string) ([]plum.TableState, error)

GetPGTables gets the user tables with their current activities and locks.

func (*Postgres) GetTrackActivitiesSetting

func (p *Postgres) GetTrackActivitiesSetting(ctx context.Context) (string, error)

GetTrackActivitiesSetting retrieves the "track_activities" Postgres setting.

func (*Postgres) GetUserTables

func (p *Postgres) GetUserTables(ctx context.Context) (plum.Tables, error)

GetUserTables fetches all the rows from pg_stat_user_tables view.

Jump to

Keyboard shortcuts

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