On Tuesday, May 10, 2016 02:46:16 PM Kevin Mcintyre wrote: > I see that sqlite has table information via sqlite_master > > http://www.sqlite.org/faq.html#q7 > > Is this table available in Qt localstorage?
Hi! I modified the sample from the documentation: To get the info you should query this as a table, for example to show current tables in the database: import QtQuick 2.5 import QtQuick.Window 2.2 import QtQuick.LocalStorage 2.0 Window { visible: true Text { text: "?" anchors.horizontalCenter: /parent/.horizontalCenter function /findGreetings/() { var /db/ = LocalStorage.openDatabaseSync("QQmlExampleDB", "1.0", "The Example QML SQL!", 1000000); /db/.transaction(function(tx) { // Create the database if it doesn't already exist /tx/.executeSql('CREATE TABLE IF NOT EXISTS ' + 'Greeting(salutation TEXT, salutee TEXT)'); // Show all tables var /rs/ = /tx/.executeSql('SELECT name FROM sqlite_master ' + 'WHERE type="table"'); var /r/ = "" for(var /i/ = 0; /i/ < /rs/.rows.length; /i/++) { /r/ += /rs/.rows.item(/i/).name + "\n" } /text/ = /r/ } ) } Component.onCompleted: /findGreetings/() } } -- Best regards, Jesus
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest