Transaction.executeSql blocks the app's flow

I have an SQLite database with a table contains about 50,000 records. Every time I select all records in that table by using this query SELECT id FROM table, the app has to wait for executeSql to be complete and I can’t interact with the app at that time. However, in the document, executeSql is an async function. So I want to ask about how can this be possible? Is it because SQLite can’t handle that many records?

Hey @concua123,

Where in the documentation does it indicate executeSql is an async function?



Hi @adamjnav

Sorry, I didn’t mean that executeSql is a JS async function. But executeSql run asynchronously because I see 2 callback functions.

Rechecked the document, it doesn’t say the executeSql run asynchronously. So sorry for my wrong assumption :frowning:

OK I’ve figured out how to resolve this problem.

Instead of query a whole list at one time. Ex: SELECT * FROM tableName.
I select the records with LIMIT offset, limit statement to reduce the list’s size.

No apologies necessary! Glad you got it working!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.