Hi
I'm currently developing a package manager (for linux) (yes I know, yet another, useless...) and I'm using XML files for the database. But the problem of that way is the slowdown and the memory cost of xml files + XPath query
So I'm exploring other ways to store the database.
The first other way I want to try is sqlite, because it has perfect bindings for python (my favorite scripting language) allowing the quick creation (less than one hour, including tests, RTFM...) of a convertion tool XML => sqlite
After the convertion, I get a 8,6MB database, with a table files containing about 140000 records, a packages table with about 440 records...
The draft of the database is here (a picture showing the relations between tables) : http://pinaraf.robertlan.eu.org/schemadb.png (you'll notice some differences)
I'm trying some "simple" query. The first query is "Whose file is it ?"
Here is my first SQL query for that (ran with the sqlite3 command) :
sqlite> SELECT p.name FROM packages p, files f WHERE f.pkgid=p.pkgid AND f.filename="/usr/bin/gcc";
gcc-core
try a join instead.
select p.name from packages p join files f on f.pkgid = p.pkgid where f.filename="/usr/bin/gcc";
-- Tobias