Documentation
¶
Index ¶
- func BeginTx(ctx context.Context, db *sql.DB, txOptions *sql.TxOptions, returnedErr *error) (*sql.Tx, func(), error)
- type Execer
- type Queryer
- type Stmt
- func (s *Stmt) Append(sqlFrag string) *Stmt
- func (s *Stmt) Exec(ctx context.Context, execer Execer) (sql.Result, error)
- func (s *Stmt) Format(args ...interface{}) *Stmt
- func (s *Stmt) Query(ctx context.Context, queryer Queryer, callback func() bool) error
- func (s *Stmt) QueryRow(ctx context.Context, queryer Queryer) error
- func (s *Stmt) SQL() string
- func (s *Stmt) Scan(values ...interface{}) *Stmt
- func (s *Stmt) Trim(sqlFrag string) *Stmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Execer ¶
type Execer interface {
ExecContext(ctx context.Context, query string, args ...interface{}) (result sql.Result, err error)
}
Execer is an interface implemented by `sql.DB` and `sql.Tx`.
type Queryer ¶
type Queryer interface { QueryRowContext(ctx context.Context, query string, args ...interface{}) (row *sql.Row) QueryContext(ctx context.Context, query string, args ...interface{}) (rows *sql.Rows, err error) }
Queryer is an interface implemented by `sql.DB` and `sql.Tx`.
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
Stmt represents a SQL statement.
func (*Stmt) Query ¶
Query executes the Stmt as a query to retrieve rows. The given callback will be called for each row retrieved. If the callback returns false, the iteration will be stopped.
Click to show internal directories.
Click to hide internal directories.