shad-go/lectures/07-sql/sqlx/ext.go

24 lines
591 B
Go
Raw Normal View History

2020-04-09 11:15:34 +00:00
package sqlx
import (
"context"
"database/sql"
"github.com/jmoiron/sqlx"
)
2020-04-08 19:20:23 +00:00
type QueryerContext interface {
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
2020-04-09 11:15:34 +00:00
QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error)
QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row
2020-04-08 19:20:23 +00:00
}
type ExecerContext interface {
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
}
type ExtContext interface {
QueryerContext
ExecerContext
}