开发者

Best way to get rows changed in an sqlite db

开发者 https://www.devze.com 2023-03-22 01:02 出处:网络
I\'m watching an sqlite db which an app uses. I want to know what changes have been made since I last checked.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消