scotttrinh / angular-localForage

Angular service & directive for https://github.com/mozilla/localForage (Offline storage, improved.)
MIT License
651 stars 86 forks source link

question: angular-localForage support indexedDB, webSQL, localstorage, but i don't know which one it is the default choice #126

Closed shangliyang closed 8 years ago

shangliyang commented 8 years ago

question 1: angular-localForage support indexedDB, webSQL, localstorage, but i don't know which one it is the default choice ?

question 2: Testing in different environment (chrome, ie, iphone...), did it automatically select to use with indexedDB or webSQL, or localstorage?

question 3: How do I calculate the size of angular-localForage. example: has been used 12 M on my App . question 4: angular- localForage support SQL language?

scotttrinh commented 8 years ago
  1. IndexedDB is the default choice if it's supported, but you can set which one to use explicitly with setDriver.
  2. If you want to make sure it's consistent between environments, feel free to set it explicitly. One of the goals of localForage is to abstract over the differences, so it shouldn't matter. As far as tests are concerned, you can treat it as a black box since localForage's API doesn't change based on the backend.
  3. It is 6.95 KB minified.
  4. Nope. If you want to use SQL, you can use WebSQL directly, but you will be limited to only the browsers that support it. There are plenty of other in-browser database implementations, and I just found one that looks like it implements SQL directly: AlaSQL

I'm going to close this issue, but feel free to ask any more questions to help you get up and running. If you want some more basic understanding of localForage, definitely read up on their repo since this is really just an Angular wrapper around that library.