I am new to Ionic and I have been working on SQLite but I cannot make this work for a week now, and its quite frustrating .
I have tried some plugins such as litehelpers/Cordova-sqlite-storage, litehelpers/cordova-sqlite-ext, and some others but it doesnt seem to work for me. Some plugins return âCannot find sqlitePluginâ error.
I also tried openDatabase() { this.sqlite.create({name: âdata.dbâ, location: âdefaultâ}).then((db: SQLiteObject) but it does not read my existing database. BTW, I am using a real Android device to test.
What I want to achieve is, just load the data from the database that I previously created using DB Browser for SQLite. I have tried putting the sqlite file into my www but its still not working. I got errors like cannot open database. The database that I am talking to about already has tables and data stored so I will just be reading them and showing data to the user. Is it possible to achieve this?
Its difficult to imagine creating hundreds or thousands of INSERT statements that is why I just want to load the database with existing tables and data.
I donât need help on this anymore. I just became helpless on this. What I did is put all the data in a json file and encode them into something. Thanks!
Of course it is not. Its just that I really do not know how to solve my problem and I became helpless. I even searched about it on search engines for one week without success. But anyway, thanks for your willingness to help.
Well i had the same problem, i actually spent weeks trying to get it to work and finally succeeded. if you or anyone else are still interested on how I was able to do it let me know!
Though I previously said that I put my data into json, I was able to solve it in another project. I just followed https://ionicframework.com/docs/native/sqlite/ and put my db in www folder. Thatâs it.
HiâŚI tried to do the same i put my db file in www folder and assets folder as well but it is still showing âno such table existsâ error.Please let me know if i missed something.