Thu Jun 11 11:18:25 AM MDT 2026 Let’s talk about what today is. Today is a rather ungrateful day. It’s a Thursday, so that’s got to mean something. Of course I thought yesterday was Thursday. Such a bummer. I’m freezing today. I don’t know how hot it’s supposed to get outside? But I feel cold. I don’t usually feel cold in the summertime. I hope I’m not getting sick or coming down with something. I’m sitting in my office and I have my minky on my lap because I’m freezing! Sami’s friend dropped off some chairs so we have a place to sit now. They’re nice oversized comfy chairs too! Only cost her eight dollars, so that’s what we paid for them. It feels good to have a place to sit in while writing or watching TV again. Talk about a good thing to have around. Last night, I had some crazy thoughts. Typical “life is a simulation” thought process. I don’t know why I am having these thoughts. They seem to come out of nowhere. It just happens to be that way though. I’m not crazy, sure I’ve be...
Here's some code I'm working on for a sqlite3 database to store backup file content. Might add a BLOB type later for storing binary data. Not sure yet.
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE files (id INTEGER PRIMARY KEY,
name TEXT,
content TEXT,
created_ts TEXT,
modified_ts TEXT);
CREATE TABLE files_log(id INTEGER PRIMARY KEY,
fileid TEXT,
name TEXT,
content TEXT,
created_ts TEXT,
modified_ts TEXT,
dt TEXT);
CREATE TRIGGER files_trig AFTER INSERT ON files
BEGIN
update files SET created_ts = datetime('now','localtime') WHERE id = NEW.id;
END;
CREATE TRIGGER files_update_trig AFTER UPDATE ON files
BEGIN
update files SET modified_ts = datetime('now','localtime') WHERE id = OLD.id;
insert into files_log(fileid, name, content, created_ts, modified_ts)
values(OLD.id, OLD.name, OLD.content, OLD.created_ts, OLD.modified_ts);
END;
CREATE TRIGGER files_log_update_trig AFTER INSERT ON files_log
BEGIN
update files_log SET dt = datetime('now', 'localtime') WHERE id = NEW.id;
END;
COMMIT;
Comments
Post a Comment