mirror of https://github.com/grafana/grafana
MSSQL: decouple plugin (#89597)
* decouple from core * yarn decouple * make health check work and azure config * f * driver error not needed * mergepull/92158/head^2
parent
4755eb5176
commit
eac194815e
@ -0,0 +1,28 @@ |
||||
package main |
||||
|
||||
import ( |
||||
"os" |
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend" |
||||
"github.com/grafana/grafana-plugin-sdk-go/backend/datasource" |
||||
"github.com/grafana/grafana-plugin-sdk-go/backend/log" |
||||
"github.com/grafana/grafana/pkg/setting" |
||||
"github.com/grafana/grafana/pkg/tsdb/mssql" |
||||
) |
||||
|
||||
func main() { |
||||
// Start listening to requests sent from Grafana. This call is blocking so
|
||||
// it won't finish until Grafana shuts down the process or the plugin choose
|
||||
// to exit by itself using os.Exit. Manage automatically manages life cycle
|
||||
// of datasource instances. It accepts datasource instance factory as first
|
||||
// argument. This factory will be automatically called on incoming request
|
||||
// from Grafana to create different instances of SampleDatasource (per datasource
|
||||
// ID). When datasource configuration changed Dispose method will be called and
|
||||
// new datasource instance created using NewSampleDatasource factory.
|
||||
logger := backend.NewLoggerWith("logger", "tsdb.mssql") |
||||
cfg := setting.NewCfg() |
||||
if err := datasource.Manage("mssql", mssql.NewInstanceSettings(cfg, logger), datasource.ManageOpts{}); err != nil { |
||||
log.DefaultLogger.Error(err.Error()) |
||||
os.Exit(1) |
||||
} |
||||
} |
@ -0,0 +1 @@ |
||||
# Changelog |
@ -0,0 +1,41 @@ |
||||
{ |
||||
"name": "@grafana-plugins/mssql", |
||||
"description": "MSSQL data source plugin", |
||||
"private": true, |
||||
"version": "11.3.0-pre", |
||||
"dependencies": { |
||||
"@emotion/css": "11.11.2", |
||||
"@grafana/data": "workspace:*", |
||||
"@grafana/experimental": "1.7.12", |
||||
"@grafana/runtime": "11.3.0-pre", |
||||
"@grafana/sql": "11.3.0-pre", |
||||
"@grafana/ui": "11.3.0-pre", |
||||
"lodash": "4.17.21", |
||||
"react": "18.2.0", |
||||
"rxjs": "7.8.1", |
||||
"tslib": "2.6.3" |
||||
}, |
||||
"devDependencies": { |
||||
"@grafana/e2e-selectors": "workspace:*", |
||||
"@grafana/plugin-configs": "workspace:*", |
||||
"@testing-library/react": "15.0.2", |
||||
"@testing-library/user-event": "14.5.2", |
||||
"@types/jest": "29.5.12", |
||||
"@types/lodash": "4.17.4", |
||||
"@types/node": "20.14.2", |
||||
"@types/react": "18.3.3", |
||||
"@types/testing-library__jest-dom": "5.14.9", |
||||
"ts-node": "10.9.2", |
||||
"typescript": "5.4.5", |
||||
"webpack": "5.91.0" |
||||
}, |
||||
"peerDependencies": { |
||||
"@grafana/runtime": "*" |
||||
}, |
||||
"scripts": { |
||||
"build": "webpack -c ./webpack.config.ts --env production", |
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)", |
||||
"dev": "webpack -w -c ./webpack.config.ts --env development" |
||||
}, |
||||
"packageManager": "yarn@4.4.0" |
||||
} |
@ -0,0 +1,4 @@ |
||||
{ |
||||
"extends": "@grafana/plugin-configs/tsconfig.json", |
||||
"include": ["."] |
||||
} |
@ -0,0 +1,4 @@ |
||||
import config from '@grafana/plugin-configs/webpack.config'; |
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config; |
Loading…
Reference in new issue