Thanks for the report on qt-project, I just faced this exact same issue this
afternoon (my app is not released yet but I already wanted to see if a DB
update will be possible).
It's a shame not to be able to open the DB without specifying the version :/
Waiting for improvements on QML LocalStorage API, I've found out via
StackOverflow the table_info SQLite Pragma statement:
http://www.sqlite.org/pragma.html#pragma_table_info
With that, you can either look at the number of columns of your table, or
iterate through the rows returned to see if your new column name already exists
or not.
--
Sylvain.
Date: Sat, 15 Feb 2014 17:42:15 +0100
From: r...@hoelz.ro
To: devel@lists.sailfishos.org
Subject: Re: [SailfishDevel] Getting odd error when attempting to use
LocalStorage.changeVersion
On Sat, 15 Feb 2014 01:47:52 +0100
Rob Hoelz r...@hoelz.ro wrote:
Hi all,
I'm working on an update for my Sudoku application, and one of the new
features necessitates a storage schema change. So I wrote a utility
function that tries to open a connection with the correct version, and
falls back to calling db.changeVersion if there is a version mismatch.
After testing my new code out, I get the following output from my
application:
[nemo@jolla Databases]$ harbour-sudoku
[D] QWaylandEglIntegration::QWaylandEglIntegration:58 - Using
Wayland-EGL [W] QQmlImportDatabase::importPlugin:1697 - Module
'Sailfish.Silica' does not contain a module identifier directive - it
cannot be protected from external registrations. [D]
MLocalThemeDaemonClient::MLocalThemeDaemonClient:81 -
MLocalThemeDaemonClient::MLocalThemeDaemonClient(const
QString,QObject*) Theme: jolla-ambient [D]
MLocalThemeDaemonClient::MLocalThemeDaemonClient:112 -
LocalThemeDaemonClient: Looking for assets in
(/usr/share/themes/blanco/meegotouch,
/usr/share/themes/jolla-ambient/meegotouch) [W]
QSqlDatabasePrivate::database:280 - QSqlDatabasePrivate::database:
unable to open database: QSqlQuery::prepare: database not open
DeclarativeCoverWindow: I have a default alpha buffer [W]
QSqlDatabasePrivate::database:280 - QSqlDatabasePrivate::database:
unable to open database: [W] QSqlDatabasePrivate::database:280 -
QSqlDatabasePrivate::database: unable to open database:
QSqlQuery::prepare: database not open
Here's the code for the routine in question:
https://github.com/hoelzro/harbour-sudoku/blob/db-upgrade/qml/pages/SudokuBoard.qml#L126
It looks to me like once LocalStorage attempts to open a database and
fails, it doesn't actually open databases in the future, but I could
be misunderstanding something.
If anyone could help, I'd really appreciate it.
Thanks,
Rob
___
SailfishOS.org Devel mailing list
This seems to be a generic Qt issue; I've started a thread here:
http://qt-project.org/forums/viewthread/38458/
-Rob
___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list