mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-08-21 20:18:42 +02:00
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
|
||
|
}
|