Documentation ¶
Index ¶
- type DB
- type GddDB
- func (g GddDB) BeginTxx(ctx context.Context, opts *sql.TxOptions) (GddTx, error)
- func (g GddDB) ExecContext(ctx context.Context, query string, args ...interface{}) (ret sql.Result, err error)
- func (g GddDB) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) (err error)
- func (g GddDB) NamedExecContext(ctx context.Context, query string, arg interface{}) (ret sql.Result, err error)
- func (g GddDB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) (err error)
- type GddDBOption
- type GddTx
- func (g GddTx) ExecContext(ctx context.Context, query string, args ...interface{}) (ret sql.Result, err error)
- func (g GddTx) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) (err error)
- func (g GddTx) NamedExecContext(ctx context.Context, query string, arg interface{}) (ret sql.Result, err error)
- func (g GddTx) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) (err error)
- type Querier
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { Querier BeginTxx(ctx context.Context, opts *sql.TxOptions) (GddTx, error) Close() error }
DB wraps sqlx.Tx and sqlx.DB https://github.com/jmoiron/sqlx/issues/344#issuecomment-318372779
type GddDB ¶
GddDB wraps sqlx.DB
func (GddDB) ExecContext ¶
func (GddDB) GetContext ¶
func (GddDB) NamedExecContext ¶
type GddDBOption ¶
type GddDBOption func(*GddDB)
func WithCache ¶
func WithCache(store *cache.Cache) GddDBOption
func WithLogger ¶
func WithLogger(logger logger.SqlLogger) GddDBOption
func WithRedisKeyTTL ¶
func WithRedisKeyTTL(ttl time.Duration) GddDBOption
type GddTx ¶
GddTx wraps sqlx.Tx
func (GddTx) ExecContext ¶
func (GddTx) GetContext ¶
func (GddTx) NamedExecContext ¶
type Querier ¶
type Querier interface { NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error Rebind(query string) string BindNamed(query string, arg interface{}) (string, []interface{}, error) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error }
Querier common operations for sqlx.Tx and sqlx.DB
Click to show internal directories.
Click to hide internal directories.