Important: Please read the Qt Code of Conduct -

Inserted Data not getting saved in DB.

  • I'm using a local DB in my project.

    Something like:


    The access is made after setting the offline storage path like:

    #ifdef Q_WS_SIMULATOR
    QString privatePathQt(QApplication::applicationDirPath());
    QString pathOfflineStorage(privatePathQt);
    pathOfflineStorage = QDir::toNativeSeparators(pathOfflineStorage);

    and then in QML:

    var database = openDatabaseSync("db123","1.0","db123",1000000);
    function(tx) {
    var rs = tx.executeSql("SELECT * FROM table");

    Everything's fine untill here, i get the correct number of regists in that table.
    Then i update it by inserting some more and get the correct updated amount.

    When i restart the app the DB loads with the same number of regists as before(it didn't save the changes i did while in the simulator/device)

Log in to reply