Documentation
¶
Index ¶
- type CommandTag
- type DB
- func (db *DB) Begin(ctx context.Context) (psql.Tx, error)
- func (db *DB) Close() error
- func (db *DB) Exec(ctx context.Context, stmt string, args ...any) (psql.CommandTag, error)
- func (db *DB) Ping(ctx context.Context) error
- func (db *DB) Query(ctx context.Context, dst any, query string, args ...any) error
- func (db *DB) QueryRow(ctx context.Context, dst any, query string, args ...any) error
- func (db *DB) TxHistory() []*Tx
- type Tx
- func (tx *Tx) Commit(ctx context.Context) error
- func (tx *Tx) Exec(ctx context.Context, stmt string, args ...any) (psql.CommandTag, error)
- func (tx *Tx) Query(ctx context.Context, dst any, query string, args ...any) error
- func (tx *Tx) QueryRow(ctx context.Context, dst any, query string, args ...any) error
- func (tx *Tx) Rollback(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandTag ¶
func (CommandTag) Delete ¶
func (ct CommandTag) Delete() bool
func (CommandTag) Insert ¶
func (ct CommandTag) Insert() bool
func (CommandTag) RowsAffected ¶
func (ct CommandTag) RowsAffected() int64
func (CommandTag) Select ¶
func (ct CommandTag) Select() bool
func (CommandTag) String ¶
func (ct CommandTag) String() string
func (CommandTag) Update ¶
func (ct CommandTag) Update() bool
type DB ¶
type DB struct { BeginCalledTimes int BeginCalledWith []context.Context MockBegin func(ctx context.Context) (*Tx, error) CloseCalledTimes int MockClose func() error ExecCalledTimes int ExecCalledWithContext []context.Context ExecCalledWithStmt []string ExecCalledWithArgs [][]any MockExec func(ctx context.Context, stmt string, args ...any) (CommandTag, error) PingCalledTimes int PingCalledWith []context.Context MockPing func(ctx context.Context) error QueryCalledTimes int QueryCalledWithContext []context.Context QueryCalledWithDst []any QueryCalledWithQuery []string QueryCalledWithArgs [][]any MockQuery func(ctx context.Context, dst any, query string, args ...any) error QueryRowCalledTimes int QueryRowCalledWithContext []context.Context QueryRowCalledWithDst []any QueryRowCalledWithQuery []string QueryRowCalledWithArgs [][]any MockQueryRow func(ctx context.Context, dst any, query string, args ...any) error // contains filtered or unexported fields }
type Tx ¶
type Tx struct { CommitCalledTimes int CommitCalledWith []context.Context MockCommit func(ctx context.Context) error ExecCalledTimes int ExecCalledWithContext []context.Context ExecCalledWithStmt []string ExecCalledWithArgs [][]any MockExec func(ctx context.Context, stmt string, args ...any) (CommandTag, error) QueryCalledTimes int QueryCalledWithContext []context.Context QueryCalledWithDst []any QueryCalledWithQuery []string QueryCalledWithArgs [][]any MockQuery func(ctx context.Context, dst any, query string, args ...any) error QueryRowCalledTimes int QueryRowCalledWithContext []context.Context QueryRowCalledWithDst []any QueryRowCalledWithQuery []string QueryRowCalledWithArgs [][]any MockQueryRow func(ctx context.Context, dst any, query string, args ...any) error RollbackCalledTimes int RollbackCalledWith []context.Context MockRollback func(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.