gendb

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type GetActivityRow

type GetActivityRow struct {
	Pid              pgtype.Int4
	State            pgtype.Text
	BlockedBy        []int32
	WaitEventType    pgtype.Text
	WaitEvent        pgtype.Text
	Query            pgtype.Text
	BackendType      pgtype.Text
	Datname          pgtype.Text
	Usename          pgtype.Text
	ApplicationName  pgtype.Text
	ClientAddr       *netip.Addr
	ClientHostname   pgtype.Text
	ClientPort       pgtype.Int4
	CurrentTimestamp pgtype.Timestamptz
	BackendStart     pgtype.Timestamptz
	XactStart        pgtype.Timestamptz
	QueryStart       pgtype.Timestamptz
	StateChange      pgtype.Timestamptz
	BackendXid       pgtype.Uint32
}

type GetLocksForPidsRow

type GetLocksForPidsRow struct {
	Pid                pgtype.Int4
	Locktype           pgtype.Text
	Mode               pgtype.Text
	Granted            pgtype.Bool
	Waitstart          pgtype.Timestamptz
	Relation           pgtype.Uint32
	Page               pgtype.Int4
	Tuple              pgtype.Int2
	Virtualxid         pgtype.Text
	Transactionid      pgtype.Uint32
	Classid            pgtype.Uint32
	Objid              pgtype.Uint32
	Objsubid           pgtype.Int2
	Virtualtransaction pgtype.Text
	Relname            pgtype.Text
	Relkind            string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetActivity

func (q *Queries) GetActivity(ctx context.Context) ([]GetActivityRow, error)

func (*Queries) GetLocksForPids

func (q *Queries) GetLocksForPids(ctx context.Context, pids []pgtype.Uint32) ([]GetLocksForPidsRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

Jump to

Keyboard shortcuts

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