[RFC] Database Abstraction Proposal - Request for Comments (Devs and DB Admins only!)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
megacrypto Offline
Senior Member
Posts: 219
Joined: Apr 2008
Reputation: 0
Post: #41
Im sorry, i dont quite follow what the mysql patch does exactly? Im running XBMC r26004, does that mean that i can use my mySQL DB to store my data? if so, how can I achieve that?

I don't know if this was mentioned before, but in order to have a central DB, there will have to be an id for each XBMC box (master - client or something like that). Also some of the DB tables will have to include such box ID in case the paths are different from one box to the other (i.e. my box i have the folders named in one way, my kids box they have their folders named in another way, etc..)

But, kindly, if there is a way to use mySQL with XBMC, could someone plz explain how.

thanks
find quote
firnsy Offline
Team-XBMC Developer
Posts: 104
Joined: Jul 2009
Reputation: 0
Location: Australia
Post: #42
The improved abstraction was pushed into mainline around r25622 and ticket #8169 has the initial patches to integrate mysql support. It is pending review for inclusion, and given the holiday season it may take a few more weeks before it gets a decent look.

All necessary information should be available in the ticket. If you're regularly compiling from the source then I would encourage you to apply the patches, test and provide feedback of your efforts.
find quote
Andrewishy Offline
Junior Member
Posts: 33
Joined: Oct 2008
Reputation: 0
Post: #43
Thanks for the comments firnsy

Just one concern about the central db is it will require a server to be on all the time, I'm currently using a dumb NAS drive for my content so don't have another spare server (and I don't think the average user would have one either)

I'll create another thread with some more ideas and will have a play with the code if anyone would be interested in a patch to do this
find quote
firnsy Offline
Team-XBMC Developer
Posts: 104
Joined: Jul 2009
Reputation: 0
Location: Australia
Post: #44
Andrewishy Wrote:Just one concern about the central db is it will require a server to be on all the time, I'm currently using a dumb NAS drive for my content so don't have another spare server (and I don't think the average user would have one either)

Yes it does require a server to be up all the time (just like your NAS has to be up all the time). The patches should safely fall back to the local database (via SQLite3) when the remote database is not available.

This is an advanced feature set and is not expected to be initially adopted by the average user with a dumb NAS drive. You could always re-flash your NAS and make it smarter Laugh
find quote
Andrewishy Offline
Junior Member
Posts: 33
Joined: Oct 2008
Reputation: 0
Post: #45
Quote:Originally Posted by firnsy
Quote:Originally Posted by Andrewishy
Just one concern about the central db is it will require a server to be on all the time, I'm currently using a dumb NAS drive for my content so don't have another spare server (and I don't think the average user would have one either)
Yes it does require a server to be up all the time (just like your NAS has to be up all the time). The patches should safely fall back to the local database (via SQLite3) when the remote database is not available.

This is an advanced feature set and is not expected to be initially adopted by the average user with a dumb NAS drive. You could always re-flash your NAS and make it smarter
The NAS is an off the shelf device and only supports file sharing and i so don't want to re-flash it to make it do other things (its a Ethernet/USB external HD not a full uPnP device so low power but good enough for HD video transfer).

Good luck with the db stuff, I'll concentrate on the exporting of the data as I think these are separate features.

I'll propose something in another thread after some more thoughts
find quote
da-anda Offline
Team-XBMC Member
Posts: 1,396
Joined: Jun 2009
Reputation: 27
Location: germany
Post: #46
I wonder if the "server" will only require a MySQL database up and running (of which many NAS are capable of), or if it'll also need some other XBMC server software for real client/server communication etc. and a dedicated API.
I'm not sure if there could raise some issues if every XBMC client tries to play server and updates the db at the same time (maybe through automated folder rescans on startup etc.). So I think on the long run a "server version" of XBMC might be the best solution (imagine centralized skin and gui configuration for clients/accounts/usergroups etc.). Even client dependent local media shouldn't be a problem to be indexed server side, as you could use the UNC paths (\\my-client-pc\d$\local\folder\structure.mpg) and by this would even be possible to share the local media accross the other clients (assuming clients have access to that computer/share).
Once the unifiedPVR is ready, many of the users will have a dedicated TVserver with WOL anyway and some of us do already - so a XBMC server would be a great improvement I think and is the way to go in future. So maybe keep that in mind when restructuring the DB. What do you think?
(This post was last modified: 2009-12-28 11:11 by da-anda.)
find quote
megacrypto Offline
Senior Member
Posts: 219
Joined: Apr 2008
Reputation: 0
Post: #47
firnsy Wrote:The improved abstraction was pushed into mainline around r25622 and ticket #8169 has the initial patches to integrate mysql support. It is pending review for inclusion, and given the holiday season it may take a few more weeks before it gets a decent look.

All necessary information should be available in the ticket. If you're regularly compiling from the source then I would encourage you to apply the patches, test and provide feedback of your efforts.

I got the 2 patches from the ticket, but was wondering if you could provide me with how to apply them... not very experienced in patching apps Confused
(This post was last modified: 2009-12-29 17:17 by megacrypto.)
find quote
firnsy Offline
Team-XBMC Developer
Posts: 104
Joined: Jul 2009
Reputation: 0
Location: Australia
Post: #48
megacrypto Wrote:I got the 2 patches from the ticket, but was wondering if you could provide me with how to apply them... not very experienced in patching apps Confused

Whilst this is not the forum to discuss how to apply patches, you should execute the following commands in the parent directory of the xbmc source tree.

Code:
patch -p1 < /path/to/database_mysql_support_with_safe_fallback.patch

Code:
patch -p1 < /path/to/database_indexed_column_changes.patch
find quote
oliver Offline
Junior Member
Posts: 2
Joined: Dec 2009
Reputation: 0
Post: #49
Maybe a stupid question, but what is the current status of database abstraction/support in xbmc.

I tried to install the gentoo ebuild and it wanted to get mysql in badly. I removed the mysql reference in the external libraries section of configure.in and boostraped it. it configured and is currently compiling fine.

I thought the original xbmc used sqlite only and that this whole post was about getting database abstraction. If this is the case, why does the build still force mysql support? Will xbmc even work without mysql?
find quote
spiff Offline
Grumpy Bastard Developer
Posts: 12,181
Joined: Nov 2003
Reputation: 82
Post: #50
it currently pulls mysqlclient and it's used for the mythtv support.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Post Reply