Documentation
¶
Index ¶
- type PostgresDB
- func (db *PostgresDB) Begin(ctx context.Context) (pgx.Tx, error)
- func (db *PostgresDB) Exec(ctx context.Context, sql string, args ...interface{}) (int64, error)
- func (db *PostgresDB) HealthChecks() []healthkit.Check
- func (db *PostgresDB) Name() string
- func (db *PostgresDB) Pool() *pgxpool.Pool
- func (db *PostgresDB) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
- func (db *PostgresDB) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
- func (db *PostgresDB) Ready() <-chan struct{}
- func (db *PostgresDB) Start(ctx context.Context) error
- func (db *PostgresDB) Stop(ctx context.Context) error
- type PostgresOption
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) 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) Ready ¶
func (db *PostgresDB) Ready() <-chan struct{}
type PostgresOption ¶
type PostgresOption func(*PostgresDB)
func WithConnectionString ¶
func WithConnectionString(connStr string) PostgresOption
func WithDBName ¶
func WithDBName(name string) PostgresOption
Click to show internal directories.
Click to hide internal directories.