Lunny Xiao
5053c35701
All checks were successful
continuous-integration/drone/push Build is passing
don't keep db on dialects Reviewed-on: #1623
23 lines
516 B
Go
23 lines
516 B
Go
package core
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
)
|
|
|
|
// Queryer represents an interface to query a SQL to get data from database
|
|
type Queryer interface {
|
|
QueryContext(ctx context.Context, query string, args ...interface{}) (*Rows, error)
|
|
}
|
|
|
|
// Executer represents an interface to execute a SQL
|
|
type Executer interface {
|
|
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
|
|
}
|
|
|
|
// QueryExecuter combines the Queryer and Executer
|
|
type QueryExecuter interface {
|
|
Queryer
|
|
Executer
|
|
}
|