Alex's blog

More evil SQLite

Published on 2022-07-15

Here's some more evil use of SQLite.

CREATE TRIGGER sqlar_update
    ON sqlar
    -- ...

(Explanation: sqlar is the name of the table used for a SQLite Archive. Here I've implemented it as a view, rather than a table, and written INSTEAD OF triggers to translate UPDATEs, and INSERTs and DELETEs too, to the radically differently-arranged tables that the view pulls from. So my rather complex format should also as a side feature be accessible by the SQLite shell as an archive (or by the standalone sqlar program).)

Tagged: Personal, Databases, SQLite, Evil