Search code examples
sqlitereliabilityuser-feedback

Providing reliable user feedback with SQLite


I'm writing an application with a GUI frontend (GTK) and an SQLite backend. When something is changed via the GUI, I want the change to show up in the GUI if and only if it completed successfully in the DB.

  • Is watching the return code from sqlite3_step for SQLITE_ERROR sufficient to ensure that I don't give false feedback to the user?

  • If not, are there other steps, such as callbacks or triggers, that would provide additional reliability?

  • Is there any way to detect ALL changes to the database, rather than just ones from the program's own connection, so that I could reflect changes to its content in the GUI dynamically?


Solution

  • Besides exception handling... You should reselect the data from the db that the user did commit by clicking on the save button. That way you know for sure that the user sees the right data.