This life is here for a reason, we don’t have to say exactly what that reason is, we just have to believe in it no matter what happens in this life, we have to understand one thing. That thing is that we are not alone in the universe. I’m not saying there are aliens out there, but yeah there are aliens out there. It’s a concept that people have wondered about from time to time, there doesn’t appear to be anything else you can do but wonder what’s going on in the skies above us! There are so many things in this life that don’t always seem to matter, but you wish they would, at least that’s what I’d like to think would happen. I’m not sure that’s how this life is meant to be understood of course. If there’s anything in this life that doesn’t make sense, then it will always be there. It doesn’t have to make sense, that’s the absurdity of it all! Why should it make sense if there’s nothing to grasp from it all? I’m not sure I know the ansewr to that question. Such a life comes and goes an...
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