Documentation
¶
Index ¶
- func Query[T any](db Db, ctx context.Context, sql string, f func(row pgx.Rows) (*T, error), ...) ([]*T, error)
- type Db
- type Dummy
- func (d *Dummy) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
- func (d *Dummy) Close()
- func (d *Dummy) Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error)
- func (d *Dummy) Ping(ctx context.Context) error
- func (d *Dummy) Pool() *pgxpool.Pool
- func (d *Dummy) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
- func (d *Dummy) QueryInt(ctx context.Context, sql string, args ...interface{}) (int64, error)
- func (d *Dummy) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
- type Option
- type Postgres
- func (d *Postgres) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
- func (d *Postgres) Close()
- func (d *Postgres) Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error)
- func (d *Postgres) Ping(ctx context.Context) error
- func (d *Postgres) Pool() *pgxpool.Pool
- func (d *Postgres) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
- func (d *Postgres) QueryInt(ctx context.Context, sql string, args ...interface{}) (int64, error)
- func (d *Postgres) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
- type Resp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Db ¶
type Db interface {
Ping(ctx context.Context) error
Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
QueryInt(ctx context.Context, sql string, args ...interface{}) (int64, error)
Exec(ctx context.Context, sql string, args ...interface{}) (pgconn.CommandTag, error)
BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
Pool() *pgxpool.Pool
Close()
}
type Dummy ¶
type Option ¶
type Option func(db *Postgres)
func WithConnectionTimeout ¶
func WithHealthCheckPeriod ¶
func WithMaxConnections ¶
func WithTLSConfig ¶
Click to show internal directories.
Click to hide internal directories.