grafana / sqlds

A package that assists writing SQL-driven datasources
Apache License 2.0
20 stars 12 forks source link

Database connections are not closed when a new datasource is created #135

Closed njvrzm closed 1 month ago

njvrzm commented 1 month ago

grafana-plugin-sdk-go supports a Dispose() method to be called when a new Instance is to be created. Sqlds does not currently support this. This leaks database connections in some circumstances.

SQLDatasource should support the InstanceDisposer interface and have its Connector close its open database connections when Dispose() is called. I'm working on a PR for this now.