Sqlite - Does this implementation working these days?



Since documentation of storage is a bit unclear and we were having some break changes I want to know if this is an valid tutorial these days or if this is broken like all those in the internet for sqlite and ionic v2. If not, there is some useful material for working with sqlite and ionic v2 that I can use?

Best Regards,
Welder Marcos

I would suggest taking a hard look at whether ionic-storage can serve your needs. It is much easier to work with during development, because it seamlessly works in a browser environment, whereas you are going to have to mock or swap out the database interface by hand if you are dealing with SQLite directly.

hey, if you want to use SQLite see examples in my project https://github.com/luckychel/VLTPayback/blob/master/src/services/settings-service.ts

I’ve already did. Since there is not query method (or at least no example of it) there is no way to fit it in my needs. To explain, I have an web service that provides my data in the first time. After that the oparations need to be done offline. Since the data is a bit complex with foreign keys and hundreads of thousands of records I need to query then efficiently. Methods like get and set seems to me quite ‘weak’.

thanks @luckychel, I’ll check that for sure.

I would recommend this - https://gist.github.com/aggarwalankush/0b700328e797e22a1d9994cb35afdf09

See usage in this app - https://github.com/aggarwalankush/ionic2-mosum/blob/master/src/pages/providers/database.service.ts

This code reminds me of the old Ionic SQLStorage. I used to get frustrated with the fact that it had access to transactions, but no way for users to use them. I get that they’re hard to manage, but it seems to me that anybody who needs to be dealing directly with SQLite (and OP definitely seems like a candidate after hearing how complex the data is) is going to want if not need transactions.

Thank u very much @ankushagg93. Ill give it a try. Nice app by the way, great work.