Best way to get rows changed in an sqlite db
I'm watching an sqlite db which an app uses.
I want to know what changes have been made since I last checked.
I can dump to sql and diff against the last dump, but it seems there should be a better way.
Is there?
Thanks, Kent
PS Not to be coy, specifics: I'm managing photos with Shotwell, which has a great GUI. I'm mirroring Shotwell's db in Postgresql, where I've restru开发者_JAVA技巧ctured and augmented to my liking. After a Shotwell session, which involves adding, tagging, adjusting ... I want to apply those changes to Postgres.
Add a field named _changed
to your table(s). On every manipulation (update
, insert into
...) of a row set the field to the current timestamp. Now you can check which rows have been updated since.
精彩评论