[Bug] Statement Query and Exec methods can not be used with sql.Conn

This commit is contained in:
go-jet 2022-05-13 14:04:11 +02:00
parent 84dbda5948
commit 3b0285cc4b
4 changed files with 71 additions and 18 deletions

View file

@ -13,3 +13,13 @@ type DB interface {
Query(query string, args ...interface{}) (*sql.Rows, error)
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
}
// Queryable interface for sql QueryContext method
type Queryable interface {
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
}
// Executable interface for sql ExecContext method
type Executable interface {
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
}