0

I have made an application in QML that uses U1Db qml Api (sdk 15.04.5). The Application create a database to save his data. The application is already loaded on Ubuntu store and available to the users.

The databased is created with:

U1db.Database {
      id: mypeopleDb
      path: Qt.resolvedUrl("MyPeople_db");
}

What will happen at the exisitng database when i'll upload a new version of the Application to the Ubuntu store and users will update the old Application ? The old Database will be lost? overwritten ? reused ?

What is the best solution to manage that situation ?

Thanks

1 Answer 1

0

To have a sure response at my question i have tryed myself with my app:

1) I have uploaded to the Ubuntu store the new version of the app

2) I have updated the old app version (already installed on my Tablet) with the new one (using the ubuntu update features of the tablet)

Conclusion:

the old Database created by the old app version was NOT reused by the new App: a new blank one was created (NO modification was made to the database structure).

I have verified that the old database was NOT lost (is mantained in the file system). The Databases created with U1Db QML API are placed in a folder under this path:

~phablet/.local/share//file:/opt/click.ubuntu.com/"applicationName"/"version"/"NameApplication"/

where: "applicationName" is the value inserted in the field 'applicationName' inside Main.qml of the source code

"version" is the application version (eg: 1.1)

"NameApplication" is the name of the App

So that that the database for old App version 1.0 is inside:

~phablet/.loca/share/"applicationName"/file:/opt/click.ubuntu.com/"applicationName"/1.0/"NameApplication"/

And the one for the new version 1.1 is inside:

~phablet/.loca/share/"applicationName"/file:/opt/click.ubuntu.com/"applicationName"/1.1/"NameApplication"/

To use the old database is necessary copy the Database file from the old folder to the new one, overwriting the other one. To do do this is possbile use the Terminal app or with the File Manager of the Tablet (after enabling the option to show the hidden folders in the File manager menu (.local is an hidden folder in the home one)).

I have verified that creating the database without QT.resolveurl("..."):

U1db.Database {
        id: mypeopleDb1_0 
        path: "MyPeople_db";
}

the database file will be placed in the folder:

.local/share/"applicationName" without any references at the application verion number.

So that i think that the right solution is NOT use QT.resolvedUrl() to prevent problems in case of App updates.

So, the new question is: how is possible create and export/import content from a DB file ? Seem that using the U1DB QML API is not possible....

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .