PostgreSQL: Initial new PostgreSQL Persistence Service. #2804 #2805
Conversation
org.openhab.core.library.types, | ||
org.openhab.core.persistence, | ||
org.openhab.core.types, | ||
org.openhab.io.net.http, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that import really used in your code?
Hi @lewie, i had a quick look through the code. Please find my comments inline and some general comments below:
Since this binding seem to be a merely a copy of the mysql binding this leads to tremendous code duplication which i am not very keen on. Have you had a look into the JPA binding? Would that work for you as well? Best, Thomas E.-E. |
Absolutely, I agree! But JPA is saving Item values all in one Table as Strings, for me this is not a good solution (limited scalability). As you can see, I have build in a Function for Table renaming (Prefix as Itemnames or simple "item", Suffix as ID with zeros filled). In short, this would be a Merge of Mysql-, PostgreSql-, JPA-Service to one Extended-JPA-Service. But it takes Time, we all don't have, isn't it. Rgds |
OK, STOP! What do you think of this solution? What would be a good name: Rgds |
Just to add one voice as a user of MySQL persistence: I would not like to see the existing MySQL persistence code changed to accommodate an additional database engine, since this will cause issues. Perhaps either evolve the JPA persistence bundle, or make a new, generic JDBC persistence bundle that works with PostgresSQL and possibly other configurable JDBC drivers (but knowing that driver-swappable JDBC under OSGi is a configuration headache, along the lines of this, for example). |
@watou: Then a generic JDBC persistence bundle would be the best Choice, isn't it. Either way, it would, however, be an additional Bundle. Rgds |
Based on a quick read through the MySQL and JPA code, I agree that a more generic JDBC persistence bundle would make sense, with the goal that it would support as many JDBC drivers as users expressed interest in using. Eventually, it could obsolete the MySQL persistence bundle and yet be fully compatible with existing MySQL databases that were created by the MySQL persistence bundle. That way, you get PostgresSQL support but without creating "yet another" database-specific persistence bundle, and without disturbing the existing MySQL bundle. I'm sure Kai, Thomas and others have thoughts and know the history better, but this is my take for now. |
@watou: That sounds great for me. The only Thing I want to say: My name proposal for the new Service would be: "JDBC" ;-) @teichsta: In the meantime, I withdraw my PR Rgds |
No description provided.