summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/sql/data/1-creation.js
blob: aab9b5dc7508484d2a0b165d47dcf19945e67866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function test() {
    var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
    var r="transaction_not_finished";

    // Asynchronous in WebKit, so must wait before calling test()  
    db.transaction(
        function(tx) {
            tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
            tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
            r = "passed";
        }
    );

    return r;
}