Overthinking, yet again. I’m not sure what to think about this life most days. If I said it was confusing, that would be telling the truth. But what can I do about it? Not much I’m afraid. Not much at all. That’s how the cookie crumbles at times. It’s a silly thought now isn’t it? That’s what I was thinking too! If life had a purpose, what would it be? There are so many things in this life which require our undivided attention. You cannot deny that as a fact. It’s proof that life exists for a reason. A pretty good reason if you ask me. Life, at various times, is full of surprises. They can be good or bad, I think it all depends on the situation. Nothing in life is set in stone as it is always on the move towards adventure. But we can’t always be tied down to that which we don’t have. We don’t have control over things we don’t have or aren’t in our orbit. ’Tis the beast’s true nature that one. Confusing at times? Most definitely. Talk about an upset on a most terrible scale of terrib...
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