Reading a pre-populated sqlite database using react native with expo..
I recently needed to read an existing sqlite database, and return its contents to the react native front-end on an android emulator. I read several related posts on the subject but they all give examples of console logging, never returning. I faced quite some difficulties, and hence decided to create this post as a blog. Hope it helps someone who comes here looking for a solution. Usually, there are two main issues that you would face. One, you would notice that simply opening a database and fetching won't work. You need to copy the local database to an internal document store and then use that database. Second, you would notice that there is no way of 'returning' the value of a variable in the traditional sense of the term. You must handle it within the async function itself. So follow me for the solution. Step 1. Create the root folder. From the terminal in the root folder, create the react native app with expo using : expo init newApp Choose the blank te...