Documentation ¶
Index ¶
- func ToSnakeCase(s string) string
- type Client
- func (db *Client) Exec(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (db *Client) ExecNamed(ctx context.Context, query string, arg any) (sql.Result, error)
- func (db *Client) RunInTransaction(ctx context.Context, txFunc TxFunc, opts ...TxOption) (err error)
- func (db *Client) Select(ctx context.Context, ptr any, query string, args ...any) error
- func (db *Client) SelectRow(ctx context.Context, ptr any, query string, args ...any) error
- type DB
- type Option
- type Transactional
- type Tx
- func (t *Tx) Exec(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (t *Tx) ExecNamed(ctx context.Context, query string, arg any) (sql.Result, error)
- func (t *Tx) Select(ctx context.Context, ptr any, query string, args ...any) error
- func (t *Tx) SelectRow(ctx context.Context, ptr any, query string, args ...any) error
- type TxFunc
- type TxOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToSnakeCase ¶
Types ¶
type Client ¶
func (*Client) RunInTransaction ¶
type DB ¶
type DB interface { Select(ctx context.Context, ptr any, query string, args ...any) error SelectRow(ctx context.Context, ptr any, query string, args ...any) error Exec(ctx context.Context, query string, args ...any) (sql.Result, error) ExecNamed(ctx context.Context, query string, arg any) (sql.Result, error) }
type Option ¶
type Option func(db *Client)
func WithQueryTracer ¶
func WithQueryTracer(tracers ...pgx.QueryTracer) Option
type Transactional ¶
type TxOption ¶
type TxOption func(options *txOptions)
func IsolationLevel ¶
func IsolationLevel(level sql.IsolationLevel) TxOption
Click to show internal directories.
Click to hide internal directories.