Using SQLite in QML - How to persist data on application shutdown



  • Hi, I am able to create a sql lite database connection, create tables and add data to the tables via javascript. Problem is on application shutdown the data is not persisted to a file. Is it even possible to persist for future application starts and restarts, or is the sql data file deleted on application shut down?

    Thanks



  • I'm not sure I understand.
    Are you using the QtQuick.LocalStorage import? Or are you writing your own adapter / C++ object which does the sqlite storage and exposes API to QML?

    If the former, and there is a specific bug with the way that persisted data is not available after application restart, then please file a bug with a minimal test case, in the Qt Project JIRA.

    If the latter, then most likely there's a bug in your adapter (eg, you might not be committing the changes that you've written or something, and so the updates are being lost when you close your application, because they haven't been persisted to disc).

    Cheers,
    Chris.




Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.