4 ms·
How would you tail or watch a sqlite log? (on a pdp-11 if necessary :)
by mhio 2y ago
How would you tail or watch a sqlite log? (on a pdp-11 if necessary :)
- jasomill 2y agoWrite a program using https://www.sqlite.org/c3ref/update_hook.html https://www.sqlite.org/c3ref/update_hook.html On a PDP-11, run this program via telnet, rsh, or rexec. If you're more ambitious, porting SQLite to 2.11BSD would be a fun exercise.
- themk 2y agoUpdate hook doesn't trigger if the write happened from a different process.
- mhio 2y agoInteresting, that's a requirement for an out of band tailing tool. Maybe a user defined function bound to an INSERT trigger. But I believe that functions are also connection specific which is fine for the tail tool, but what happens when the user defined function connection goes away.
- mhio 2y agoNope. Triggers and user defined functions don't help across processes either.
- miah_ 2y ago`watch -n 5 sqlite3 logs.db "select log from logs" | grep whatever`
- SpaceNoodled 2y agoJust what I wanted, additional overhead and a five-second delay.