databasekit

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresDB

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

func NewPostgresDB

func NewPostgresDB(ctx context.Context, options ...PostgresOption) (*PostgresDB, error)

func (*PostgresDB) Begin

func (db *PostgresDB) Begin(ctx context.Context) (pgx.Tx, error)

func (*PostgresDB) Exec

func (db *PostgresDB) Exec(ctx context.Context, sql string, args ...interface{}) (int64, error)

func (*PostgresDB) HealthChecks

func (db *PostgresDB) HealthChecks() []healthkit.Check

func (*PostgresDB) Name

func (db *PostgresDB) Name() string

func (*PostgresDB) Pool

func (db *PostgresDB) Pool() *pgxpool.Pool

func (*PostgresDB) Query

func (db *PostgresDB) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)

func (*PostgresDB) QueryRow

func (db *PostgresDB) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row

func (*PostgresDB) Ready

func (db *PostgresDB) Ready() <-chan struct{}

func (*PostgresDB) Start

func (db *PostgresDB) Start(ctx context.Context) error

func (*PostgresDB) Stop

func (db *PostgresDB) Stop(ctx context.Context) error

type PostgresOption

type PostgresOption func(*PostgresDB)

func WithConnectionString

func WithConnectionString(connStr string) PostgresOption

func WithDBName

func WithDBName(name string) PostgresOption

Jump to

Keyboard shortcuts

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