English subtitles

← IndexedDB - Mobile Web Development

Get Embed Code
4 Languages

Showing Revision 4 created 05/25/2016 by Udacity Robot.

  1. So, what should you use if you need
  2. a complex data storage system? Well, there's one more
  3. system, the Indexed Database API, also called IndexedDB for
  4. short. Indexed Database was designed in response to Web
  5. SQL, and its SQLite variant. Indexed Database is
  6. not a SQL API, it's a simpler index storage
  7. system, on which you can build an optimized query
  8. implementation, like a, a SQL variant. This means it
  9. isn't optimized to a particular query system. Instead, when
  10. you create your database, you define what indexes you want
  11. to use. If you've never done database storage before,
  12. IndexDB may take a little bit of getting used to,
  13. but it's actually pretty straight forward. The spec itself
  14. has some really good examples in it. This code is
  15. based on the spec. FIrst, you need to open
  16. your database and you need to be prepared to initialize
  17. the database if it hasn't been opened before. When you
  18. initialize the database, you can define the indexes in the
  19. database, that is, what attributes are easily searchable. You can
  20. change this later too, you just have to upgrade the database.
  21. And of course you can inspect the databases in the
  22. developer tools to see what's going in to the IndexDB store.
  23. And check to make sure it's organized the way you
  24. want it. Just go into the Resources tab, select IndexDB, and
  25. there you go. You can see your objects right there.
  26. If you expand them, you can even see the values.