You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I´m developing a app with cordova+framework7+sqlite-ext. The app works offline, and synchronize the collected data troughout the day, with a API on the server.
A JSON is builded selecting data from the database with a sql transaction and a lot of callbacks. Something like this:
db.transaction(function(tx){
tx.executeSql("select * from table1",[], function(tx, rs){
if (rs.rows.length>0) {
var tb1_id = rs.rows.item(0).tb1_id;
tx.executeSql("select * from table2 where father_id = ?,[tb1_id], function(tx,rs) {
tx.executeSql("select * from table3 where father_id = ?,[tb1_id], function(tx,rs) {
}
});
});
in between the "tx.executeSql" statments it´s loaded the results into an array of objects to be sent later to the API.
The problem is that I´m having trouble with the sync of these selects. The question is, the best way to do this kind of thing is via transaction? should I use readTransaction? should it be only the "executeSql" statments cascading? I noticed that the transaction API is deprecated.
The text was updated successfully, but these errors were encountered:
I´m developing a app with cordova+framework7+sqlite-ext. The app works offline, and synchronize the collected data troughout the day, with a API on the server.
A JSON is builded selecting data from the database with a sql transaction and a lot of callbacks. Something like this:
db.transaction(function(tx){
tx.executeSql("select * from table1",[], function(tx, rs){
if (rs.rows.length>0) {
var tb1_id = rs.rows.item(0).tb1_id;
tx.executeSql("select * from table2 where father_id = ?,[tb1_id], function(tx,rs) {
tx.executeSql("select * from table3 where father_id = ?,[tb1_id], function(tx,rs) {
}
});
});
in between the "tx.executeSql" statments it´s loaded the results into an array of objects to be sent later to the API.
The problem is that I´m having trouble with the sync of these selects. The question is, the best way to do this kind of thing is via transaction? should I use readTransaction? should it be only the "executeSql" statments cascading? I noticed that the transaction API is deprecated.
The text was updated successfully, but these errors were encountered: