Database for a DJ library


#1

Hello.

I’m needing to build a database of audio files for use with a DJ application.
I’d like to be able to handle nested playlists of tracks, and to be able to sort and search by metadata values.

Does JUCE offer anything like that, or should I be looking at something like SQL?

Many thanks


#2

Obviously you could use JUCE’s data structures or things from the C++ standard library. But it might be better in the long run to use something like Sqlite. (A full blown server process based database probably isn’t going to be necessary.)

https://www.sqlite.org/index.html


#3

To have persistency I would recommend SQL. I was thinking of writing a JUCE module that wraps SQLite, but the project died for other reasons.

Also it would be cool to implement an abstraction layer, so that you can use any kind of database adapter to the usual suspects. I would just start writing the sqlite adapter and if someone needs a bigger database, they can extend that later…

and +1 to @Xenakios, sqlite is definitively the one to start with


#4

Fantastic!
I imagine I won’t be the first or last person to want to do something like this.
I’ll give SQLite a go, and if it goes well I’ll post it on github and link it here.


#5

Sqlite is excellent.

Pick your threading model carefully though and follow the manual…


#6

I ended up using two std::maps for my tracks and playlists, accessed by an index key.
Turns out Cereal works nicely with std::maps, so that made it super simple to serialise.

Has anyone had experience using Cereal?
I’ve written some serialisation functions for some JUCE classes, and if they’re useful I’m happy to share them