mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
add sqlx_store into star service (#53430)
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
type Session interface {
|
||||
Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
|
||||
Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
|
||||
NamedExec(ctx context.Context, query string, arg interface{}) (sql.Result, error)
|
||||
}
|
||||
|
||||
type SessionDB struct {
|
||||
@@ -33,6 +34,10 @@ func (gs *SessionDB) Exec(ctx context.Context, query string, args ...interface{}
|
||||
return gs.sqlxdb.ExecContext(ctx, gs.sqlxdb.Rebind(query), args...)
|
||||
}
|
||||
|
||||
func (gs *SessionDB) NamedExec(ctx context.Context, query string, arg interface{}) (sql.Result, error) {
|
||||
return gs.sqlxdb.NamedExecContext(ctx, gs.sqlxdb.Rebind(query), arg)
|
||||
}
|
||||
|
||||
func (gs *SessionDB) driverName() string {
|
||||
return gs.sqlxdb.DriverName()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user