Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED]How to access sqlite rowid
-
Hi,
I have a LocalStorage with a table created withtx.executeSql('CREATE TABLE IF NOT EXISTS Cards(one TEXT, two TEXT)');
Now I'm trying to update the model with:var rs = tx.executeSql('SELECT * FROM Cards'); model.clear() for(var i = 0; i < rs.rows.length; i++) { var item = rs.rows.item(i); console.debug("update", item.rowid); model.append({"rowid":item.rowid, "one": item.one, "two": item.two}); }
But I'm just getting the output
qml: update undefined
Does someone know how to access the implicit sqlite rowid?
Thanks in advance.
-
@belab
Found it:var rs = tx.executeSql('SELECT rowid, * FROM Cards');