openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

Enhance persistence service with queries

Open BasvanH opened this issue 7 months ago • 1 comments

I've created this issue because of this forum post.

Currently you can only fetch data ranges from the persistence service. The returned data points are linear to whats stored in the backed database. You cant use any database functions/queries.

If the persistence service would be enhanced with database functions/queries we could benefit of the following advantages:

  • Less items to store processed data en thus less complexity and resources needed.
  • Enhanced graphing.
  • Less complicated rules to process data.
  • Reduce the need of BI tools, enhance the experience of single pane of glass for your data analysis.

I understand that not all backed persistence databases engines can utilize queries/functions, this however should not limit this enhancement. We could add features per specific database or perhaps make some segmentation between them. A user can take this feature into account when choosing a database engine.

What I consider as needed, and please feel free to comment / add more.

  • Grouping / aggregate functions like SUM / AVG / MIN / MAX / COUNT
  • WHERE conditions
  • Selecting from multiple tables with JOINS

BasvanH avatar Nov 21 '23 20:11 BasvanH