ADDED pages/aff_short.in Index: pages/aff_short.in ================================================================== --- /dev/null +++ pages/aff_short.in @@ -0,0 +1,92 @@ +hd_keywords *affshort {file-format benefits} +Benefits of SQLite As A File Format + +

+SQLite As An Application File Format +

+ +

(Note: The current page is a brief summary of why SQLite makes +a good application file format. The topic is considered at greater +detail in a [application file-format | separate technical note].)

+ +

+SQLite has been used with great success as the on-disk file format +for desktop applications such as version control systems, +financial analysis tools, media cataloging and editing suites, CAD +packages, record keeping programs, and so forth. The traditional +File/Open operation calls sqlite3_open() to attach to the database +file. Updates happen automatically as application content is revised +so the File/Save menu option becomes superfluous. The File/Save_As +menu option can be implemented using the [backup API]. +

+ +

+There are many advantages to using SQLite as an application file format, +including: +

+ +
    +
  1. Better performance + +
  2. Reduced application cost and complexity + +
  3. Portability + +
  4. Reliability + +
  5. Accessibility + +
+ +

+SQLite allows database files to have any desired filename extension, so +an application can choose a custom filename extension for its own use, if +desired. The [application_id pragma] can be used to set an "Application ID" +integer in the database file so that tools like +[http://www.darwinsys.com/file/ | file(1)] can determine that the file +is associated with your application and is not just a generic +SQL database.

Index: pages/capi3ref.in ================================================================== --- pages/capi3ref.in +++ pages/capi3ref.in @@ -1,9 +1,6 @@ C/C++ Interface For SQLite Version 3 - -

C/C++ Interface For SQLite Version 3

- set in [open sqlite3.h] set title {} ;# title of a section of interface definition set type {} ;# one of: constant datatype function set body {} ;# human-readable description @@ -237,44 +234,39 @@ hd_header Introduction hd_enable_main 0 hd_keywords *capi3ref {C-language Interface} -

These pages define the C-language interface to SQLite.

+

+C-language Interface Specification for SQLite +

-

This is not a tutorial. These -pages are designed to be precise, not easy to read. -For a tutorial introduction see -[quickstart | SQLite In 3 Minutes Or Less] and/or -the [cintro | Introduction To The SQLite C/C++ Interface]. +

These pages are intended to be precise and detailed specification. +For a tutorial introduction, see instead: +

+This same content is also available as a +single large HTML file.

-

This version of the C-language interface reference is -broken down into small pages for easy viewing. The -same content is also available as a -single large HTML file -for those who prefer that format.

- -

The content on these pages is extracted from comments -in the source code.

- -

The interface is broken down into three categories:

+

The SQLite interface elements can be grouped into three categories:

  1. List Of Objects. This is a list of all abstract objects and datatypes used by the SQLite library. There are couple dozen objects in total, but - the three most important objects are: - A database connection object [sqlite3], - prepared statement object [sqlite3_stmt], and the 64-bit integer - type [sqlite3_int64].

  2. + the two most important objects are: + A database connection object [sqlite3], and the + prepared statement object [sqlite3_stmt].

  3. List Of Constants. This is a list of numeric constants used by SQLite and represented by #defines in the sqlite3.h header file. These constants - are things such as numeric return parameters from - various interfaces (ex: [SQLITE_OK] or flags passed + are things such as numeric [result codes] from + various interfaces (ex: [SQLITE_OK]) or flags passed into functions to control behavior (ex: [SQLITE_OPEN_READONLY]).

  4. List Of Functions. This is a list of all functions and methods operating on the @@ -287,27 +279,22 @@ hd_close_aux hd_enable_main 1 -

    This page defined the C-language interface to SQLite.

    - -

    This is not a tutorial. These -pages are designed to be precise, not easy to read. -For a tutorial introduction see -[quickstart | SQLite In 3 Minutes Or Less] and/or -the [cintro | Introduction To The SQLite C/C++ Interface]. -

    - -

    This page contains all C-language interface information -in a single HTML file. The same information is also -available broken out into -lots of small pages -for easier viewing, if you prefer.

    - -

    This document is created by a script which scans comments -in the source code files.

    +

    +C-language Interface Specification for SQLite +

    + +

    This page is intended to be a precise and detailed specification. +For a tutorial introductions, see instead: +

    +This same content is also available split out into +lots of small pages.


    # Find the preferred keyword for a page given a list of @@ -395,20 +382,18 @@ hd_header {List Of SQLite Objects} hd_enable_main 0 hd_putsnl {

    SQLite C Interface

    } hd_enable_main 1
    -

    Objects:

    -

    Note: Objects marked with "[experimental | exp]" -are [experimental] and objects marked with -"[deprecated | (obs)]" are [deprecated].

    +

    List Of Objects:

    output_list 3 [lsort -nocase $objlist] hd_enable_main 0 hd_putsnl {

    Other lists: Constants and -Functions.} +Functions and +Result Codes.} hd_close_aux hd_enable_main 1 hd_putsnl {


    } # Do a table of contents for constants @@ -430,21 +415,20 @@ hd_header {List Of SQLite Constants} hd_enable_main 0 hd_putsnl {

    SQLite C Interface

    } hd_enable_main 1
    -

    Constants:

    -

    Note: Constants marked with "[experimental | (exp)]" -are [experimental] and constants marked with -"[deprecated | (obs)]" are [deprecated]

    +

    List Of Constants:

    +

    Also available: [error codes|list of error codes]

    set clist [lsort -index 1 $clist] output_list 2 $clist hd_enable_main 0 hd_putsnl {

    Other lists: Objects and -Functions.

    } +Functions and +Result Codes.

    } hd_enable_main 1 hd_close_aux hd_putsnl {
    } @@ -468,21 +452,22 @@ hd_keywords *capi3ref_funclist {C-API function list} hd_enable_main 0 hd_putsnl {

    SQLite C Interface

    } hd_enable_main 1
    -

    Functions:

    +

    List Of Functions:

    Note: Functions marked with "[experimental | (exp)]" are [experimental] and functions marked with [deprecated | (obs)] are [deprecated].

    set funclist [lsort -index 1 $funclist] output_list 3 $funclist hd_enable_main 0 hd_putsnl {

    Other lists: Constants and -Objects.

    } +Objects and +Result Codes

    } hd_enable_main 1 hd_close_aux hd_putsnl {
    } # Convert a fragment text label into a fragment name Index: pages/changes.in ================================================================== --- pages/changes.in +++ pages/changes.in @@ -16,10 +16,23 @@ global nChng aChng set aChng($nChng) [list $date $desc $options] incr nChng } +chng {2015-02-25 (3.8.8.3)} { +
  5. Fix a bug (ticket + [https://www.sqlite.org/src/info/2326c258d02ead33|2326c258d02ead33]) that can lead + to incorrect results if the qualifying constraint of a [partial index] appears in the + ON clause of a LEFT JOIN. +
  6. Added the ability to link against the + "[https://github.com/antirez/linenoise|linenoise]" + command-line editing library in unix builds of the [command-line shell]. + +
  7. SQLITE_SOURCE_ID: "2015-02-25 13:29:11 9d6c1880fb75660bbabd693175579529785f8a6b" +
  8. SHA1 for sqlite3.c: 74ee38c8c6fd175ec85a47276dfcefe8a262827a +} {patchagainst 1 patchagainst 2 patchagainst 3} + chng {2015-01-30 (3.8.8.2)} {
  9. Enhance [sqlite3_wal_checkpoint_v2(TRUNCATE)] interface so that it truncates the WAL file even if there is no checkpoint work to be done.
  10. SQLITE_SOURCE_ID: "2015-01-30 14:30:45 7757fc721220e136620a89c9d28247f28bbbc098" Index: pages/cintro.in ================================================================== --- pages/cintro.in +++ pages/cintro.in @@ -34,33 +34,94 @@ hd_puts "$num $name" } hd_keywords {*cintro} HEADING 0 {An Introduction To The SQLite C/C++ Interface} +HEADING 1 {Executive Summary} -

    - This article provides an overview to the C/C++ interface - to SQLite. -

    +

    The following two objects and eight methods comprise the essential +elements of the SQLite interface: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    [sqlite3]   The database connection object. Created by +[sqlite3_open()] and destroyed by [sqlite3_close()].
    [sqlite3_stmt] +The prepared statement object. Created by +[sqlite3_prepare()] and destroyed by [sqlite3_finalize()].
    [sqlite3_open()] +Open a connection to a new or existing SQLite database. +The constructor for [sqlite3].
    [sqlite3_prepare()] +Compile SQL text into +byte-code that will do the work of querying or updating the database. +The constructor for [sqlite3_stmt].
    [sqlite3_bind_int|sqlite3_bind()] +Store application data into +[parameters] of the original SQL.
    [sqlite3_step()] +Advance an [sqlite3_stmt] to the next result row or to completion.
    [sqlite3_column_int|sqlite3_column()] +Column values in the current result row for an [sqlite3_stmt].
    [sqlite3_finalize()] +Destructor for [sqlite3_stmt].
    [sqlite3_close()] +Destructor for [sqlite3].
    [sqlite3_exec()] +A wrapper function that does [sqlite3_prepare()], [sqlite3_step()], +[sqlite3_column_int|sqlite3_column()], and [sqlite3_finalize()] for +a string of one or more SQL statements.
    + +HEADING 1 {Introduction}

    Early versions of SQLite were very easy to learn since they only - supported 5 C/C++ interfaces. But as SQLite has grown in capability, + supported five C/C++ interfaces. But as SQLite has grown in capability, new C/C++ interfaces have been added so that now there are over 200 distinct APIs. This can be overwhelming to a new programmer. Fortunately, most of the C/C++ interfaces in SQLite are very specialized and never need to be considered. Despite having so many - entry points, the core API is still relatively simple and easy to code to. + entry points, the core API is still simple to learn and easy to code to. This article aims to provide all of the background information needed to easily understand how SQLite works.

    A separate document, [capi3ref | The SQLite C/C++ Interface], provides detailed - specifications for all of the various C/C++ APIs for SQLite. Once + specifications for all C/C++ APIs for SQLite. Once the reader understands the basic principles of operation for SQLite, [capi3ref | that document] should be used as a reference guide. This article is intended as introduction only and is neither a complete nor authoritative reference for the SQLite API. Index: pages/compile.in ================================================================== --- pages/compile.in +++ pages/compile.in @@ -526,11 +526,11 @@

    1.5 Options To Enable Features Normally Turned Off

    COMPILE_OPTION {SQLITE_ALLOW_URI_AUTHORITY} { - [URI filenames] normally throw an error is the authority section is + [URI filenames] normally throws an error if the authority section is not either empty or "localhost". However, if SQLite is compiled with the SQLITE_ALLOW_URI_AUTHORITY compile-time option, then the URI is converted into a Uniform Naming Convention (UNC) filename and passed down to the underlying operating system that way.

    Index: pages/faq.in ================================================================== --- pages/faq.in +++ pages/faq.in @@ -522,14 +522,14 @@

    That said, there are a number of things that external programs or bugs in your hardware or OS can do to corrupt a database file. See How To Corrupt An SQLite Database File for further information. -

    Your can use PRAGMA integrity_check +

    You can use PRAGMA integrity_check to do a thorough but time intensive test of the database integrity.

    -

    Your can use PRAGMA quick_check to do a faster +

    You can use PRAGMA quick_check to do a faster but less thorough test of the database integrity.

    Depending how badly your database is corrupted, you may be able to recover some of the data by using the CLI to dump the schema and contents to a file and then recreate. Unfortunately, once humpty-dumpty falls off Index: pages/features.in ================================================================== --- pages/features.in +++ pages/features.in @@ -6,12 +6,14 @@

  11. Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures.
  12. Zero-configuration - no setup or administration needed.
  13. -
  14. Implements most of SQL92. - (Features not supported)
  15. +
  16. Full SQL implementation + with advanced features like [partial indexes] + and [common table expressions]. + (Omitted features)
  17. A complete database is stored in a single cross-platform disk file. Great for use as an [application file format].
  18. Supports terabyte-sized databases and gigabyte-sized strings and blobs. (See limits.html.) @@ -27,12 +29,12 @@ single ANSI-C source-code file that is [how to compile|easy to compile] and hence is easy to add into a larger project.
  19. Self-contained: no external dependencies.
  20. -
  21. Cross-platform: Unix (Linux, Mac OS-X, Android, iOS) and Windows - (Win32, WinCE, WinRT) +
  22. Cross-platform: Android, *BSD, iOS, Linux, Mac, Solaris, VxWorks, + and Windows (Win32, WinCE, WinRT) are supported out of the box. Easy to port to other systems.
  23. Sources are in the public domain. Use for any purpose.
  24. Comes with a standalone [command-line interface] (CLI) client that can be used to administer SQLite databases.
  25. @@ -40,25 +42,25 @@

    Suggested Uses For SQLite:

    Index: pages/howtocompile.in ================================================================== --- pages/howtocompile.in +++ pages/howtocompile.in @@ -20,11 +20,11 @@ In other words, this article provides ideas and insights, not turnkey solutions.

    Amalgamation Versus Individual Source Files

    -

    SQLite is built from over one hundred of files of C code and script +

    SQLite is built from over one hundred files of C code and script spread across multiple directories. The implementation of SQLite is pure ANSI-C, but many of the C-language source code files are either generated or transformed by auxiliary C programs and AWK, SED, and TCL scripts prior to being incorporated into the finished SQLite library. Building the necessary C programs and transforming and/or creating the Index: pages/index.in ================================================================== --- pages/index.in +++ pages/index.in @@ -70,21 +70,24 @@

    Current Status

    Common Links