Does SQLite save the last modified row date?

Does SQLite save the last modified date of a string, such as a file system?
If not, how can I do this?

+5
source share
3 answers

I think you can add a column to your table and create a trigger to update the column value using datetime ('now');

+10
source

No.

Add the last column to your table and update it when this row changes.

+4
source
CREATE TRIGGER update_appInfo_updatetime  BEFORE update ON appInfo 
begin
update appinfo set updatedatetime = strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime') where bundle_id = old.bundle_id;
end

CREATE TABLE "appInfo" (bundle_id text NOT NULL PRIMARY KEY,appname text,title text DEFAULT appname,display_image text DEFAULT "default.gif",full_size_image text DEFAULT "default.gif",bundle_version text DEFAULT "1.0",company_id text,ipaname text,createdatetime text DEFAULT (strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime')),updatedatetime text DEFAULT (strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime')))
+2
source

All Articles