Tagsistant

All your files, quickly and easily.
SQL(ite) schema used to store tags and cache
Tuesday, 19 August 2008 15:02

WARNING: the informations in this page refer to tagsistant 0.2. Starting from tagsistant 0.4 development cycle, this informations are obsolete.

 

Tagsistant uses SQLite to store informations, starting from revision 23. Tags and relations are stored in two tables, the first asserting the existance of a tag while the second stating that a file has been tagged.

Let's see the schema used. First table is called tags:

idinteger primary key autoincrement not null
tagnamevarchar unique not null

This table id values are later used in tagged table to bind tags and contents:

idinteger primary key autoincrement not null
tagnamevarchar not null
filenamevarchar not null

filename is the name of the file relative to archive/ directory.

Every query is also cached in a separate table, with following schema:

idinteger primary key autoincrement not null
pathtext not null
agedatetime not null

Of course, the age column act as a timestamp to discard old queries. Query results are stored in a separate table which joins with this one on id column. This is the schema:

idinteger not null
agedatetime not null
pathvarchar not null

As you can see, single results are timestamped too.

Last Updated on Wednesday, 10 November 2010 22:27