This assumes all tags are strings. For the ones that are not, we can either add an intvalue column, or just store them as strings. Or we can store them as a blob somehow.
The searchvalue column can be a non-unicode, trimmed, lowercased, etc version of the value. This is for ease of searching.
We should store as many tags from a song as possible.
SQL can look something like:
create table songs(song_id INTEGER PRIMARY KEY, path STRING); create table metadata(song_id INTEGER, key STRING, value STRING, searchvalue STRING, song_id REFERENCES songs(song_id));
This assumes all tags are strings. For the ones that are not, we can either add an intvalue column, or just store them as strings. Or we can store them as a blob somehow.
The searchvalue column can be a non-unicode, trimmed, lowercased, etc version of the value. This is for ease of searching.