O'Reilly logo

Smashing Mobile Web Development by Greg Avola

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6: Creating a Mobile Web Database

HTML5 databases enable website developers to store rich content within the browser’s application cache for fast access. With the introduction of tools like Web SQL, IndexDB, LocalStorage, and other databases, you can store content for reuse after you close the browser. It’s a great way of holding information without having to use a backend database such as MySQL for the little tasks.

In addition, we discuss the HTML5 database called Web SQL. You set up the structure and learn how to process and return queries on the database. You use this to generate queries for your pagination and to insert wines into your database via the Manage tab. It’s important to note the Web SQL is not supported by Firefox, which supports another non-relational database called IndexDB. Unlike Web SQL, IndexDB is based on objects and isn’t relational (there are no schemas). It has limited support, so we don’t discuss IndexDB in this book. Firefox Mobile has very small market share, which is why it is not addressed in this book.

In this chapter, you continue to develop the sample app Corks. By the end of this chapter, you should be able to:

Understand how to implement and use Web SQL

Discuss the schema for the Web SQL that you will use for Corks

Build the initial tables needed for Corks using Web SQL

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required