If you’re using a wrapper/software layer which provides an API for your database, then you can access it via the RESTful integrations:
If not, there are other solutions - many people integrate InfluxDB and Grafana into HA using various methods - but unfortunately I have no experience with them.