mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 06:51:49 +08:00

SecretsManager: Introduce secret database wrapper Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com> Co-authored-by: Leandro Deveikis <leandro.deveikis@gmail.com> Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
21 lines
426 B
Go
21 lines
426 B
Go
package contracts
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
)
|
|
|
|
type Database interface {
|
|
DriverName() string
|
|
Transaction(ctx context.Context, f func(context.Context) error) error
|
|
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
|
|
QueryContext(ctx context.Context, query string, args ...any) (Rows, error)
|
|
}
|
|
|
|
type Rows interface {
|
|
Close() error
|
|
Next() bool
|
|
Scan(dest ...any) error
|
|
Err() error
|
|
}
|