Documentation
¶
Index ¶
- type Adapter
- type ContextManager
- type Option
- type PgxAdapter
- func (a *PgxAdapter) Begin(ctx context.Context) (Tx, error)
- func (a *PgxAdapter) Exec(ctx context.Context, sql string, args ...interface{}) error
- func (a *PgxAdapter) Get(ctx context.Context, dest interface{}, sql string, args ...interface{}) error
- func (a *PgxAdapter) Query(ctx context.Context, sql string, args ...interface{}) (Rows, error)
- func (a *PgxAdapter) Select(ctx context.Context, dest interface{}, sql string, args ...interface{}) error
- type PgxConn
- type PgxTx
- type Rows
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
Begin(ctx context.Context) (Tx, error)
Query(ctx context.Context, sql string, args ...interface{}) (Rows, error)
Exec(ctx context.Context, sql string, args ...interface{}) error
Select(ctx context.Context, dst interface{}, query string, args ...interface{}) error
Get(ctx context.Context, dst interface{}, query string, args ...interface{}) error
}
Adapter представляет интерфейс для начала транзакций
type ContextManager ¶
type ContextManager interface {
Start(ctx context.Context) (context.Context, error)
Finish(ctx context.Context, err error) error
Query(ctx context.Context, sql string, args ...interface{}) (Rows, error)
Exec(ctx context.Context, sql string, args ...interface{}) error
Select(ctx context.Context, dst interface{}, query string, args ...interface{}) error
Get(ctx context.Context, dst interface{}, query string, args ...interface{}) error
}
ContextManager управляет транзакциями на уровне сервисного слоя
func New ¶
func New(opts ...Option) ContextManager
type Option ¶
type Option func(*contextManager)
func WithAdapter ¶
func WithLogging ¶
func WithPgxAdapter ¶
type PgxAdapter ¶
type PgxAdapter struct {
// contains filtered or unexported fields
}
func (*PgxAdapter) Exec ¶
func (a *PgxAdapter) Exec(ctx context.Context, sql string, args ...interface{}) error
func (*PgxAdapter) Get ¶ added in v1.0.0
func (a *PgxAdapter) Get(ctx context.Context, dest interface{}, sql string, args ...interface{}) error
Click to show internal directories.
Click to hide internal directories.