2017-04-25 10:17:45 -05:00
|
|
|
package sqlstore
|
|
|
|
|
|
|
|
import (
|
2021-10-11 07:35:03 -05:00
|
|
|
"context"
|
|
|
|
|
2020-02-29 06:35:15 -06:00
|
|
|
"github.com/grafana/grafana/pkg/models"
|
2017-04-25 10:17:45 -05:00
|
|
|
)
|
|
|
|
|
2021-10-11 07:35:03 -05:00
|
|
|
// GetDBHealthQuery executes a query to check
|
|
|
|
// the availability of the database.
|
2022-02-04 07:33:35 -06:00
|
|
|
func (ss *SQLStore) GetDBHealthQuery(ctx context.Context, query *models.GetDBHealthQuery) error {
|
2022-02-17 09:59:09 -06:00
|
|
|
return ss.WithDbSession(ctx, func(session *DBSession) error {
|
2021-10-11 07:35:03 -05:00
|
|
|
_, err := session.Exec("SELECT 1")
|
|
|
|
return err
|
|
|
|
})
|
2017-04-25 10:17:45 -05:00
|
|
|
}
|