Documentation
¶
Index ¶
- func Query[T any](db Db, ctx context.Context, sql string, f func(row pgx.Rows) (*T, error), ...) ([]*T, error)
- func QueryRow[T any](db Db, ctx context.Context, sql string, ...) (*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 DummyTx
- func (td *DummyTx) Begin(ctx context.Context) (pgx.Tx, error)
- func (td *DummyTx) Commit(ctx context.Context) error
- func (td *DummyTx) Conn() *pgx.Conn
- func (td *DummyTx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (td *DummyTx) Exec(ctx context.Context, sql string, arguments ...any) (commandTag pgconn.CommandTag, err error)
- func (td *DummyTx) LargeObjects() pgx.LargeObjects
- func (td *DummyTx) Prepare(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error)
- func (td *DummyTx) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
- func (td *DummyTx) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
- func (td *DummyTx) Rollback(ctx context.Context) error
- func (td *DummyTx) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults
- 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 DummyTx ¶ added in v0.0.3
type DummyTx struct { CalledCommit bool CalledRollback bool ExecError error QueryRowResponse pgx.Row }
func (*DummyTx) LargeObjects ¶ added in v0.0.3
func (td *DummyTx) LargeObjects() pgx.LargeObjects
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.