Trigger.io経由でjsがデバイス(iosおよびandroid)のsqlite dbにアクセスする例はありますか?
2 に答える
            2        
        
		
通常の Web データベース API が利用可能です: http://www.w3.org/TR/webdatabase/
注: すべてのブラウザーが Web SQL をサポートしているわけではありませんhttp://caniuse.com/#feat=sql-storage
たとえば、実行するテストの 1 つが次のようなものです。
var db = openDatabase('mydb', '1.0', 'example database', 2 * 1024 * 1024);
db.transaction(function (tx) {
    tx.executeSql('CREATE TABLE IF NOT EXISTS foo (id unique, text)');  
    tx.executeSql('INSERT INTO foo (id, text) VALUES (1, "foobar")');
});
db.transaction(function (tx) {
    tx.executeSql('DROP TABLE foo');
    // known to fail - so should rollback the DROP statement
    tx.executeSql('INSERT INTO foo (id, text) VALUES (1, "foobar")');
    forge.logging.error("INSERT into non-existent table succeeded!");
}, function (err) {
    forge.logging.info("error callback invoked, as expected");
});
db.transaction(function (tx) {
    tx.executeSql('SELECT * FROM foo', [], function (tx, results) {
        forge.logging.info("row: "+results);
    });
});
    于 2012-05-09T08:38:03.753   に答える
    
    
            0        
        
		
最近では、LocalForageのようなものを使用する必要があります。これは、indexedDB から webSQL、localStorage へのフォールバックに加えて、一貫した API を提供するためです。そして、Angular/Ionic を使用している場合、これはビジネスです: Angular-LocalForage
于 2014-08-11T11:19:28.150   に答える