FS#8852 - Add SQLite to the pluginlib

Attached to Project: Rockbox
Opened by Nicolas Pennequin (nicolas_p) - Sunday, 06 April 2008, 01:28 GMT
Last edited by Alex Parker (BigBambi) - Sunday, 06 June 2010, 11:31 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


SQLite is a fast and lightweight SQL database engine library.
See for more information.

This patch makes it available to use in a plugin and provides a usage example.

Additionally to the patch, the actual library is required. You need to download the amalgamation, available at
It is not included for obvious size reasons.
Extract both sqlite3.c and sqlite3.h to apps/plugins/lib/ and add the following line to the top of sqlite3.c :
#include sqlite3_aux.h
(this file contains everything necessary to make the library compile in the rockbox environment)

The binary size is still very high, we need to strip some features off to make it smaller.

For testing, an SQLite version of the Northwind database is available">

This is mainly an experiment. I have no intention of adding it to the core or use it to replace the current Database. However, it might open interesting possibilities for plugins.

Thanks to Frank Gevaerts for helping me with this :)
This task depends upon

View Dependency Graph

This task blocks these from closing
 FS#9071 - Display sheets of OpenStreetMap,org Open Street Map 
Closed by  Alex Parker (BigBambi)
Sunday, 06 June 2010, 11:31 GMT
Reason for closing:  Later
Additional comments about closing:  Added to s
Comment by Nicolas Pennequin (nicolas_p) - Sunday, 06 April 2008, 15:21 GMT
This version has rockboxSync and rockboxDelete implemented in the VFS, which makes it work much better (the previous version wouldn't write the second column to the actual DB file). It will also link on coldfire targets.
Comment by Dan Everton (safetydan) - Wednesday, 04 June 2008, 10:52 GMT
For those of you thinking (like me) of trying to replace tagcache with SQLite here's some size comparisons base on m68k compilation:

Full SQLite compile: sqlite3.o = 476708 bytes
Every optional feature omitted SQLite compile: sqlite3.o = 280664 bytes

tagcache.o: 35880 bytes

These numbers are from SQLite 3.5.9 and the latest SVN of Rockbox. I know object file size != final linked size but it's useful for comparison.
Comment by Joseph Garvin (dataangel) - Sunday, 14 September 2008, 14:40 GMT
I'm thinking of working on a rockbox version of mnemosyne ( and a nice database API like this would help a lot.