Time flies, code flows and a new stable release of Tracker is here. Already 0.10, and a lot of improvements everywhere. Maybe another day i can write about the internals, but the big news for the developers using (or eager to use) tracker is libtracker-sparql.

libtracker-sparql is our client library to query/update data in Tracker. GObject-oriented, written in vala, easy and straight-forward: open a connection, run a query, retrieve the results. Look how easy the example looks.

Under the hood a lot of things happen. It allows sync and async queries. Also it chooses the best method to talk with tracker, depending on your versions of dbus and sqlite. Both libraries got new features and we use all of them: if your dbus is recent enough tracker will try to use the “fd-passing” feature (the processes only exchange a file descriptor to read from, instead of a huge string), and if your sqlite is recent enough it has WAL (the new journaling system) and your process will open the database directly (only for reading), no more dbus to transfer results!!

All this technicalities improve a lot the performance (less or better dbus usage) but thanks to WAL we can offer a very valuable new feature: cursors. If the application is reading directly from the DB, the results will be loaded when needed. This wasn’t possible in a dbus-based API where the client needed either to retrieve everything (very slow) or simulate cursors with LIMIT and OFFSET.

libtracker-sparql is convenient enough to start using it in different programs. The next obvious steps are to enable the gobject-introspection, and to build a live model on top of it. In the Q-World it is done, so definitely is possible.