Sqlite synchronous

I used sqlite, phonegap, javascript and I m who need to get information from sqlite db.

I can get all the necessary information, insert, update, etc.

The problem is that javascript is running asynchronously. That is, it processes all other subsequent statements until all the necessary information is received from the database.

I tried using callbacks all the time, and I got tired of it since there are difficulties using loops. (cannot use sqlite queries in loops, as loop repeats before the current sqlquery is processed, which is not what I want)

Is it possible to perform these db operations synchronously?

UPDATE Revealed a new solution from here: suggestion and problems of the webkit executesql loop

+5
source share
2 answers

No, but there is a library that can help ...

http://html5sql.com/

I just started using it myself, and it allows you to execute multiple or single SQL queries with 1 callback. It may be just what you need :)

+1
source

You can use the Siminov Framework . It allows you to make synchronous / asynchronous calls in a SQLite database. It supports most hybrid frameworks such as ( Cordova , React Native , Xamarin )

, JavaScript, , .

+1

All Articles