Apress Access

The Definitive Guide to SQLite

2nd Edition

By Grant Allen , Mike Owens

  • eBook Price: $38.99
Buy eBook Buy Print Book
The Definitive Guide to SQLite, Second Edition is your one-stop resource for integrating one of the most advanced and innovative open source database management systems into your development projects.

Full Description

  • Add to Wishlist
  • ISBN13: 978-1-4302-3225-4
  • 368 Pages
  • User Level: Intermediate to Advanced
  • Publication Date: November 4, 2010
  • Available eBook Formats: EPUB, MOBI, PDF

Related Titles

  • Beginning SQL Queries, 2nd Edition
  • Relational Database Programming
  • Database Systems
  • Dynamic SQL
Full Description

Outside of the world of enterprise computing, there is one database that enables a huge range of software and hardware to flex relational database capabilities, without the baggage and cost of traditional database management systems. That database is SQLite—an embeddable database with an amazingly small footprint, yet able to handle databases of enormous size. SQLite comes equipped with an array of powerful features available through a host of programming and development environments. It is supported by languages such as C, Java, Perl, PHP, Python, Ruby, TCL, and more.

The Definitive Guide to SQLite, Second Edition is devoted to complete coverage of the latest version of this powerful database. It offers a thorough overview of SQLite’s capabilities and APIs. The book also uses SQLite as the basis for helping newcomers make their first foray into database development. In only a short time you can be writing programs as diverse as a server-side browser plug-in or the next great iPhone or Android application!

  • Learn about SQLite extensions for C, Java, Perl, PHP, Python, Ruby, and Tcl.
  • Get solid coverage of SQLite internals.
  • Explore developing iOS (iPhone) and Android applications with SQLite.

SQLite is the solution chosen for thousands of products around the world, from mobile phones and GPS devices to set-top boxes and web browsers. You almost certainly use SQLite every day without even realizing it!

What you’ll learn

  • Deploy SQLite as the database engine for iPhone and Android applications.
  • Interact with SQLite from Java, C++, PHP, and other key languages.
  • Create robust database designs, taking advantage of support for primary and foreign key constraints.
  • Embed zero-maintenance databases directly within applications that you write.
  • Improve performance through a good understanding of SQLite internals.
  • Exploit features such as the shared cache, the SQL Logic Test Suite, the Unlock and Notify APIs, and query plan improvements.

Who this book is for

The Definitive Guide to SQLite is for developers needing a zero-maintenance database solution to deploy as an embedded component within their product. The book is especially useful for mobile developers delivering applications to run on the iPhone, or on the Android platform. PHP developers will also find the book useful if they are using the default database delivered as part of a PHP installation.

Table of Contents

Table of Contents

  1. Introducing SQLite
  2. Getting Started
  3. SQL for SQLite
  4. Advanced SQL for SQLite
  5. SQLite Design and Concepts
  6. The Core C API
  7. The Extension C API
  8. Language Extensions
  9. iOS Development with SQLite
  10. Android Development with SQLite
  11. SQLite Internals and New Features
Source Code/Downloads

Downloads are available to accompany this book.

Your operating system can likely extract zipped downloads automatically, but you may require software such as WinZip for PC, or StuffIt on a Mac.


If you think that you've found an error in this book, please let us know by emailing to editorial@apress.com . You will find any confirmed erratum below, so you can check if your concern has already been addressed.

On page Ch 10:
chapter 10 sample code is not for android, it is a duplicate of chapter 9 IOS code

On page 36:
"Wherever you define a column of type integer primary key,
SQLite will apply an function for the column to create and apply monotonically
increasing values."
an function should be a function

On page 48:
The file foods.sql the should be in the root directory of the downloaded zip file is not there. It's not under the ch03 directory either.. It's under ch01 and then under examples. The reference is correct if i download the file for the first edition of the book so you only need to fix the zip file.

On page 156:
sqlite3_open_v2() expects 4 parameters, only two are included in the code shown in code Listing 6.1

On page 226:

sub step {
<A HREF="http://rubyforge.org/projects/sqlite-ruby" CLASS="URL"> my ( $self, $value ) =
@$self[0] += $value;

should be

sub step {
my ( $self, $value ) =
@$self[0] += $value;

On page 298:

Book states "Be sure to take a look at the full listings for Seinfeld.java and the related code in the sample files included."

this is in error - no such files are included. THe publisher has overwritten the android code belonging to Chapter 10 with the Apple IOS code belonging to Chapter 9. Accordingly the entire Chapter 10 is incomplete and the sample code cannot be run.


    1. PHP Objects, Patterns, and Practice


      View Book

    2. Beginning Android 3D Game Development


      View Book

    3. Troubleshooting Oracle Performance


      View Book

    4. Beginning Amazon Web Services with Node.js


      View Book