Contents

About the Authors

About the Technical Reviewer

Acknowledgments

Introduction

imagesChapter 1: Introducing SQLite

An Embedded Database

A Developer's Database

An Administrator's Database

SQLite History

Who Uses SQLite

Architecture

The Interface

The Compiler

The Virtual Machine

The Back End

Utilities and Test Code

SQLite's Features and Philosophy

Zero Configuration

Portability

Compactness

Simplicity

Flexibility

Liberal Licensing

Reliability

Convenience

Performance and Limitations

Who Should Read This Book

How This Book Is Organized

Additional Information

Summary

imagesChapter 2: Getting Started

Where to Get SQLite

SQLite on Windows

Getting the Command-Line Program

Getting the SQLite DLL

Compiling the SQLite Source Code on Windows

Building the SQLite DLL with Microsoft Visual C++

Building a Dynamically Linked SQLite Client with Visual C++

Building SQLite with MinGW

SQLite on Linux, Mac OS X, and Other POSIX Systems

Binaries and Packages

Compiling SQLite from Source

The Command-Line Program

The CLP in Shell Mode

The CLP in Command-Line Mode

Database Administration

Creating a Database

Getting Database Schema Information

Exporting Data

Importing Data

Formatting

Exporting Delimited Data

Performing Unattended Maintenance

Backing Up a Database

Getting Database File Information

Other SQLite Tools

Summary

imagesChapter 3: SQL for SQLite

The Example Database

Installation

Running the Examples

Syntax

Commands

Literals

Keywords and Identifiers

Comments

Creating a Database

Creating Tables

Altering Tables

Querying the Database

Relational Operations

select and the Operational Pipeline

Filtering

Limiting and Ordering

Functions and Aggregates

Grouping

Removing Duplicates

Joining Tables

Names and Aliases

Subqueries

Compound Queries

Conditional Results

Handling Null in SQLite

Summary

imagesChapter 4: Advanced SQL for SQLite

Modifying Data

Inserting Records

Updating Records

Deleting Records

Data Integrity

Entity Integrity

Domain Integrity

Storage Classes

Views

Indexes

Triggers

Transactions

Transaction Scopes

Conflict Resolution

Database Locks

Deadlocks

Transaction Types

Database Administration

Attaching Databases

Cleaning Databases

Database Configuration

The System Catalog

Viewing Query Plans

Summary

imagesChapter 5: SQLite Design and Concepts

The API

The Principal Data Structures

The Core API

Operational Control

Using Threads

The Extension API

Creating User-Defined Functions

Creating User-Defined Aggregates

Creating User-Defined Collations

Transactions

Transaction Life Cycles

Lock States

Read Transactions

Write Transactions

Tuning the Page Cache

Transitioning to Exclusive

Sizing the Page Cache

Waiting for Locks

Using a Busy Handler

Using the Right Transaction

Code

Using Multiple Connections

The Importance of Finalizing

Shared Cache Mode

Summary

imagesChapter 6: The Core C API

Wrapped Queries

Connecting and Disconnecting

The exec Query

The Get Table Query

Prepared Queries

Compilation

Execution

Finalization and Reset

Fetching Records

Getting Column Information

Getting Column Values

A Practical Example

Parameterized Queries

Numbered Parameters

Named Parameters

Tcl Parameters

Errors and the Unexpected

Handling Errors

Handling Busy Conditions

Handling Schema Changes

Operational Control

Commit Hooks

Rollback Hooks

Update Hooks

Authorizer Functions

Threads

Shared Cache Mode

Threads and Memory Management

Summary

imagesChapter 7: The Extension C API

The API

Registering Functions

The Step Function

Return Values

Functions

Return Values

Arrays and Cleanup Handlers

Error Conditions

Returning Input Values

Aggregates

Registration Function

A Practical Example

Collations

Collation Defined

A Simple Example

Collation on Demand

Summary

imagesChapter 8: Language Extensions

Selecting an Extension

Perl

Installation

Connecting

Query Processing

Parameter Binding

User-Defined Functions

Aggregates

Python

Installation

Connecting

Query Processing

Parameter Binding

User-Defined Functions

Aggregates

APSW as an Alternative Python Interface

Ruby

Installation

Connecting

Query Processing

Parameter Binding

User-Defined Functions

Java

Installation

Connecting

Query Processing

User-Defined Functions and Aggregates

JDBC

Tcl

Installation

Connecting

Query Processing

User-Defined Functions

PHP

Installation

Connections

Queries

User-Defined Functions and Aggregates

Summary

imagesChapter 9: iOS Development with SQLite

Prerequisites for SQLite iOS Development

Signing Up for Apple Developer

Downloading and Installing Xcode and the iOS SDK

Alternatives to Xcode

Building the iSeinfeld iOS SQLite Application

Step 1: Creating a New Xcode Project

Step 2: Adding the SQLite Framework to Your Project

Step 3: Preparing the Foods Database

Step 4: Creating Classes for the Food Data

Step 5: Accessing and Querying the SQLite DB

Step 6: Final Polish and Wiring for iSeinfeld

iSeinfeld in Action!

Working with Large SQLite Databases Under iOS

Summary

imagesChapter 10: Android Development with SQLite

Prerequisites for SQLite Android Development

Check Prerequisites and the JDK

Downloading and Installing the Android SDK Starter Package

Downloading and Installing the Android Developer Tools

Adding Android Platforms and Components

The Android SQLite Classes and Interfaces

Using the Basic Helper Class, SQLiteOpenHelper

Working with the SQLiteDatabase Class

Applying SQLiteOpenHelper and SQLiteDatabase in Practice

Querying SQLite with SQLiteQueryBuilder

Building the Seinfeld Android SQLite Application

Creating a New Android Project

Adding the Seinfeld SQLite Database to Your Project

Querying the Foods Table

Defining the User Interface

Linking the Data and User Interface

Viewing the Finished Seinfeld Application

Care and Feeding for SQLite Android Applications

Database Backup for Android

Working with Large SQLite Databases Under Android

Summary

imagesChapter 11: SQLite Internals and New Features

The B-Tree and Pager Modules

Database File Format

The B-Tree API

Manifest Typing, Storage Classes, and Affinity

Manifest Typing

Type Affinity

Affinities and Storage

Write Ahead Logging

How WAL Works

Activation and Configuration WAL

WAL Advantages and Disadvantages

Operational Issues with WAL-Enabled SQLite Databases

Summary

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.255.178