forked from grafana.jool/grafana-jool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
467 B
21 lines
467 B
package sqlstore
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/bus"
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
func init() {
|
|
bus.AddHandlerCtx("sql", GetDBHealthQuery)
|
|
}
|
|
|
|
// GetDBHealthQuery executes a query to check
|
|
// the availability of the database.
|
|
func GetDBHealthQuery(ctx context.Context, query *models.GetDBHealthQuery) error {
|
|
return withDbSession(ctx, x, func(session *DBSession) error {
|
|
_, err := session.Exec("SELECT 1")
|
|
return err
|
|
})
|
|
}
|
|
|