From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search
File:SQLite Logo.svg
Developer(s) D. Richard Hipp
Initial release August 2000 (2000-08)
Stable release 3.6.22 / January 6, 2010; 129745446 ago
Written in C
Operating system Cross-platform
Size ~225 kB
Type RDBMS (embedded)
License Public domain
Website http://sqlite.org/

SQLite is an ACID-compliant embedded relational database management system contained in a relatively small (~225 kB)[1] C programming library. The source code for SQLite is in the public domain.

The SQLite engine is not a standalone process with which the application program communicates. Instead, the SQLite library is linked in and thus becomes an integral part of the application program (though the library can be built into a dynamically loaded library). The entire database (definitions, tables, indices, and the data itself) is stored as a single cross-platform file on a host machine.



Unlike client-server database management systems, the SQLite engine is not a standalone process with which the application program communicates. Instead, the SQLite library is linked in and thus becomes an integral part of the application program. The library can also be called dynamically. The application program uses SQLite's functionality through simple function calls, which reduces latency in database access as function calls within a single process are more efficient than inter-process communication. The entire database (definitions, tables, indices, and the data itself) is stored as a single cross-platform file on a host machine. This simple design is achieved by locking the entire database file during writing.


SQLite was first designed by D. Richard Hipp in the Spring of 2000 while working for General Dynamics on contract with the United States Navy.[2] Hipp was designing software used on board guided missile destroyer ships, which were originally based on HP-UX with an IBM Informix database back-end. The design goals of SQLite were to allow the program to be operated without database installation or administration. In August 2000, version 1.0 of SQLite was released, based on gdbm (GNU Database Manager). SQLite 2.0 replaced gdbm with a custom B-tree implementation, adding support for transactions. SQLite 3.0, partially funded by America Online, added internationalization, manifest typing, and other major improvements.


SQLite implements most of the SQL-92 standard for SQL but it lacks some features. For example it has partial support for triggers, and it can't write to views. While it supports complex queries, it still has limited ALTER TABLE support, as it can't modify or delete columns.[3]

SQLite uses an unusual type system for an SQL-compatible DBMS. Instead of assigning a type to a column as in most SQL database systems, types are assigned to individual values; in language terms it is dynamically typed. Moreover, it is weakly typed in some of the same ways that Perl is: one can insert a string into an integer column (although SQLite will try to convert the string to an integer first, if the column's preferred type is integer). This adds flexibility to columns, especially when bound to a dynamically typed scripting language. However, the technique is not portable to other SQL databases. The inability to have the domain integrity coming from statically typed columns, as in typical databases, is a common criticism. The SQLite web site describes a "strict affinity" mode, but this feature has not yet been added.[4] However, it can be implemented with constraints like CHECK(typeof(x)='integer').[2]

Several computer processes or threads may access the same database without problems. Several read accesses can be satisfied in parallel. A write access can only be satisfied if no other accesses are currently being serviced, otherwise the write access fails with an error code (or can automatically be retried until a configurable timeout expires). This concurrent access situation would change when dealing with temporary tables.

A standalone program called sqlite3 is provided which can be used to create a database, define tables within it, insert and change rows, run queries and manage an SQLite database file. This program is a single executable file on the host machine. It also serves as an example for writing applications that use the SQLite library.

SQLite currently seems to be the only choice for local/client SQL storage within a web browser and within a rich internet application framework[5]; most notably all leaders in this area (Google Gears and Adobe air)[citation needed] choose SQLite. This may be because of SQLite's dynamically typed storage matches the web browser's core languages of Javascript and XML.

SQLite also has bindings for a large number of programming languages, including BASIC, C, C++, Clipper, Common Lisp, C#, Curl, Delphi, Haskell, Java, Lua, newLisp, Objective-C (on Mac OS X), OCaml, Perl, PHP, Pike (programming language), Python, REBOL, R, Ruby, Scheme, Smalltalk, Tcl and Visual Basic. There is also a COM (ActiveX) wrapper making SQLite accessible on Windows to scripted languages such as Javascript and VBScript. This adds database capabilities to HTML Applications (HTA).[6]

SQLite has automated regression testing prior to each release.[7] Over 2 million tests are run as part of a release's verification. Starting with the August 10, 2009 release of SQLite 3.6.17, SQLite releases have 100% branch test coverage, one of the components of code coverage.

ACID compliance

ACID consistency means that only valid data can be written to the database. If a transaction is executed that violates the database’s consistency rules, the entire transaction should be rolled back and the database restored to a state consistent with those rules. SQLite by design doesn't enforce integrity constraints on data written to the database by default so one could insert e.g. a string into an integer column or an invalid date into a database with no error. That means that to make an SQLite database ACID-compliant one must add check constraints to check every value before inserting it to the database, ensuring e.g. the correct data type, string length or a valid integer value. In cases when the ACID compliance is not needed or the overhead is not acceptable the consistency of data inserted into a database must be verified by an application.


SQLite development is hosted on Fossil, a distributed version control system which is itself built upon an SQLite database.[8]


  • sqlite3, available from sqlite.org, is an interactive commandline tool to run SQL commands directly. This works similar to Oracle's SQL*Plus.
  • sqlite-manager is a graphical tool that runs as a plugin to Firefox.
  • SQLite Expert is a graphical tool that runs stand alone. The free version is available at no cost, as well as a paid version with more features.
  • SQlitening is a client/server implementation of the SQLite3 database system. It is a programmer's library in standard Win32 DLL form. It is installed as a standard Windows Service. In addition to client/server mode, the library allows the programmer to also access SQLite databases in local mode. In either mode (local or client/server), the database is extremely fast and robust. SQLitening is Public Domain, source code is available.


Mozilla Firefox and Mozilla Thunderbird store a variety of configuration data (bookmarks, cookies, contacts etc.) in internally managed SQLite databases. Skype is another widely deployed application that uses SQLite.[9]

Due to its small size, SQLite is well suited to embedded systems, and is also included in Apple's iPhone OS, Symbian OS, Google's Android and Palm's webOS.[10]

See also


  1. "Distinctive Features Of SQLite". SQLite. March 3, 2008. http://www.sqlite.org/different.html. Retrieved July 9, 2009. 
  2. 2.0 2.1 Owens, Michael (2006). The Definitive Guide to SQLite. Apress. doi:10.1007/978-1-4302-0172-4_1. ISBN 978-1-59059-673-9. 
  3. "SQL Features That SQLite Does Not Implement". SQLite. January 1, 2009. http://www.sqlite.org/omitted.html. Retrieved October 14, 2009. 
  4. "Frequently Asked Questions". SQLite. January 26, 2009. http://www.sqlite.org/faq.html. Retrieved February 7, 2009. 
  5. "Web SQL Database". World Wide Web Consortium. December 22, 2009. http://w3.org/TR/webdatabase. Retrieved January 26, 2010. "all interested implementors have used the same SQL backend (Sqlite)" 
  6. "sqlite — Sqlite Wrappers". SQLite. February 7, 2009. http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers. Retrieved February 7, 2009. 
  7. "How SQLite Is Tested". SQLite. http://www.sqlite.org/testing.html. Retrieved September 12, 2009. 
  8. "Fossil: Fossil Performance". Fossil-scm.org. 2009-08-23. http://www.fossil-scm.org/index.html/doc/tip/www/stats.wiki. Retrieved 2009-09-12. 
  9. Skype client using SQLite?
  10. Well-known Users of SQLite

Further reading

  • Newman, Chris (November 9, 2004), SQLite (Developer's Library) (First ed.), Sams, p. 336, ISBN 067232685X 

External links

bg:SQLite ca:SQLite cs:SQLite de:SQLite es:SQLite fr:SQLite hr:SQLite id:SQLite it:SQLite lt:SQLite hu:SQLite nl:SQLite ja:SQLite no:SQLite pl:SQLite pt:SQLite ro:SQLite ru:SQLite sr:SQLite fi:SQLite tr:SQLite uk:SQLite vi:SQLite zh:SQLite

Personal tools

Served in 0.591 secs.