作者:閆小恰 | 来源:互联网 | 2023-01-06 16:21
ImwritinganapplicationwithaGUIfrontend(GTK)andanSQLitebackend.Whensomethingischange
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.
我正在编写一个带有GUI前端(GTK)和SQLite后端的应用程序。当通过GUI更改某些内容时,我希望更改显示在GUI中,当且仅当它在数据库中成功完成时才会显示。
Is watching the return code from sqlite3_step
for SQLITE_ERROR
sufficient to ensure that I don't give false feedback to the user?
从sqlite3_step看SQLITE_ERROR的返回代码是否足以确保我不向用户提供错误的反馈?
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?
有没有办法检测数据库的所有更改,而不仅仅是来自程序自身连接的更改,以便我可以动态地反映GUI中其内容的更改?
2 个解决方案