Documentation
¶
Index ¶
- Constants
- func MakeContextTx(ctx context.Context, tx pgx.Tx) context.Context
- type NamedQueryExecutor
- type PG
- func (pg PG) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
- func (pg PG) Close()
- func (pg PG) ExecContext(ctx context.Context, q Query, args ...interface{}) (pgconn.CommandTag, error)
- func (pg PG) ExecDelete(ctx context.Context, builder sq.DeleteBuilder) int64
- func (pg PG) ExecUpdate(ctx context.Context, builder sq.UpdateBuilder) int64
- func (pg PG) Ping(ctx context.Context) error
- func (pg PG) QueryContext(ctx context.Context, q Query, args ...interface{}) (pgx.Rows, error)
- func (pg PG) QueryContextSelect(ctx context.Context, builder sq.SelectBuilder, where map[string]interface{}) pgx.Rows
- func (pg PG) QueryRowContext(ctx context.Context, q Query, args ...interface{}) pgx.Row
- func (pg PG) QueryRowContextInsert(ctx context.Context, builder sq.InsertBuilder) pgx.Row
- func (pg PG) QueryRowContextSelect(ctx context.Context, builder sq.SelectBuilder) pgx.Row
- func (pg PG) RunTransaction(ctx context.Context, txOptions transaction.TxOptions, f TransactionalFlow) error
- func (pg PG) UpdateReturning(ctx context.Context, builder sq.UpdateBuilder) pgx.Row
- type PgDbClient
- type PgTransactionManager
- type Pinger
- type Query
- type QueryExecutor
- type SQLExecutor
- type TransactionalFlow
- type Transactor
- type TxManager
Constants ¶
View Source
const (
TxKey key = "tx"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NamedQueryExecutor ¶
type PG ¶
func (PG) ExecContext ¶
func (PG) ExecDelete ¶
func (PG) ExecUpdate ¶
func (PG) QueryContext ¶
func (PG) QueryContextSelect ¶
func (PG) QueryRowContext ¶
func (PG) QueryRowContextInsert ¶
func (PG) QueryRowContextSelect ¶
func (PG) RunTransaction ¶ added in v1.0.42
func (pg PG) RunTransaction(ctx context.Context, txOptions transaction.TxOptions, f TransactionalFlow) error
func (PG) UpdateReturning ¶
type PgDbClient ¶ added in v1.0.38
type PgDbClient struct {
// contains filtered or unexported fields
}
func NewPgDBClient ¶ added in v1.0.38
func NewPgDBClient(ctx context.Context, dsn string) (PgDbClient, error)
func (PgDbClient) API ¶ added in v1.0.38
func (c PgDbClient) API() PG
func (PgDbClient) Close ¶ added in v1.0.38
func (c PgDbClient) Close() error
func (PgDbClient) RunTransaction ¶ added in v1.0.38
func (c PgDbClient) RunTransaction(ctx context.Context, txOpts transaction.TxOptions, f TransactionalFlow) error
type PgTransactionManager ¶
type PgTransactionManager struct {
// contains filtered or unexported fields
}
func NewPgTransactionManager ¶
func NewPgTransactionManager(db Transactor) *PgTransactionManager
func (*PgTransactionManager) Transaction ¶
func (m *PgTransactionManager) Transaction(ctx context.Context, opts transaction.TxOptions, fn TransactionalFlow) (err error)
type QueryExecutor ¶
type QueryExecutor interface {
UpdateReturning(ctx context.Context, builder squirrel.UpdateBuilder) pgx.Row
ExecDelete(ctx context.Context, builder squirrel.DeleteBuilder) int64
ExecUpdate(ctx context.Context, builder squirrel.UpdateBuilder) int64
QueryContextSelect(ctx context.Context, builder squirrel.SelectBuilder, where map[string]interface{}) pgx.Rows
QueryRowContextSelect(ctx context.Context, builder squirrel.SelectBuilder) pgx.Row
QueryRowContextInsert(ctx context.Context, builder squirrel.InsertBuilder) pgx.Row
RunTransaction(ctx context.Context, txOptions transaction.TxOptions, f TransactionalFlow) error
}
type SQLExecutor ¶
type SQLExecutor interface {
//NamedQueryExecutor
QueryExecutor
Pinger
}
type TransactionalFlow ¶
type Transactor ¶
type TxManager ¶
type TxManager interface {
Transaction(ctx context.Context, opts transaction.TxOptions, f TransactionalFlow) error
}
Click to show internal directories.
Click to hide internal directories.