Back in Ionic 2’s beta days, I created an app with offline data support using Ionic’s built-in SqlStorage API. Ionic’s team even did a nice tutorial around it:
In Ionic 2 RC0,
SqlStorage classes have suddenly disappeared from
ionic-angular module. Furthermore, the Storage link in Ionic 2’s docs leads to a 404:
I wonder what happened to SqlStorage. Why was it dropped? Is there a baked-in alternative or do we now have to rely on Ionic Native’s SQLite API? Personally, I found SqlStorage’s API much simpler than SQLite’s.
That’s mentioned in the changelog for 2.0.0-rc.0, third bullet point.
Many thanks! I completely missed it before.
Hmm. I was too quick to mark @mirkonasato’s post as the solution. The changelog for v2 RC0 mentions the Storage class/module. This thread is specifically about SqlStorage. As it turned out, SqlStorage is missing from
@maxx0r: I saw that. As I said, SqlStorage is not present in @ionic/storage module. Or am I missing something?
So, basically all of the previous *Storages (i.e. LocalStorage and SqlStorage) have been combined into a singule
Storage class that acts as A simple key-value Storage module for Ionic apps (copied from the ionic-angular GitHub page). Basically this will automatically attempt to use whatever storage solution is available, including SQLite.
To clarify even further, if you just want to store Key/Value Pairs then this solution might/should work well for you. If you need full SQL support than you will indeed have to look elsewhere, such as the Ionic Native SQLite plugin you mentioned, as there’s no builtin class for this anymore.
Thanks for the explanation @SigmundFroyd. It makes a lot of sense now.