MSSQL: decouple plugin (#89597)

* decouple from core

* yarn decouple

* make health check work and azure config

* f

* driver error not needed

* merge
This commit is contained in:
Andrew Hackmann
2024-08-26 15:09:21 -05:00
committed by GitHub
parent 4755eb5176
commit eac194815e
13 changed files with 172 additions and 37 deletions
+7 -2
View File
@@ -152,8 +152,13 @@ func (e *DataSourceHandler) Dispose() {
e.log.Debug("DB disposed")
}
func (e *DataSourceHandler) Ping() error {
return e.db.Ping()
func (e *DataSourceHandler) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error) {
err := e.db.Ping()
if err != nil {
return &backend.CheckHealthResult{Status: backend.HealthStatusError, Message: e.TransformQueryError(e.log, err).Error()}, nil
}
return &backend.CheckHealthResult{Status: backend.HealthStatusOk, Message: "Database Connection OK"}, nil
}
func (e *DataSourceHandler) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {