Posts: 2,127
Joined: Jan 2015
Reputation:
60
Razze
Team-Kodi Member
Posts: 2,127
2016-01-07, 23:46
(This post was last modified: 2016-01-07, 23:47 by Razze.)
That's actually the best I could find so far.
But haven't really done anything with that and wanted to ask in the team if anyone has any experience with orms for cpp. Before digging into it more.
I had a look at the sqlite/mysql implementation in our codebase some month ago. Anything we can replace and outsource with a well tested good alternative is a win in my books.
Posts: 21
Joined: Jan 2015
Reputation:
2
This may not be specifically relevant to Kodi Core, but as a general practice...
I like to create a database abstraction layer where I keep all my SQL queries. This helps me build applications in a Model View Controller paradigm, which, if you think about it, addons for Kodi are all about MVC.
For example, Ive seen addons that have tons of pure sql queries strewn throughout. This makes the code look unnecessarily messy and difficult to maintain, especially when it comes time to move that data from one database to another, or onward to the cloud.
Additionally, the abstraction layer would be versioned in the same way that the database is. Aka MusicDB52.py -> Music52.db
Then a factory method returns the current/correct instance of the database abstraction layer.
From a Kodi core perspective, some of this this paradigm may already be in place. But I still see pure SQL queries in a lot of .cpp code.
Posts: 2,127
Joined: Jan 2015
Reputation:
60
Razze
Team-Kodi Member
Posts: 2,127
Yes, but this is all pretty abstracted from the database schema. So changing the schema, which isn't the biggest problem isn't going to solve the big problem. (focusing on database/interraction only)
Posts: 38
Joined: Nov 2013
Reputation:
0
Could this not be done as emby has been done? I have that as well, but has issues with my synology. It seems that we have choices on the backend now, so maybe that is an option?
This doesn't seem to be getting the traction it needs to be even considered by team kodi anytime soon.
Posts: 38
Joined: Nov 2013
Reputation:
0
Someone correct me if I'm wrong, but it's a 3rd party add on that overrides kodi dB with its own. It allows for some coil parental controls, and other things.
Seems to me that if they can have their database take over with an add-on, this can too. Just another option besides trying to corral cats.