Difference between revisions of "SQLite"

From ArchWiki
Jump to: navigation, search
(A quick overview of sqlite3)
 
m (Style)
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
===About===
+
[[Category:Database management systems]]
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.
+
  
===HomePage===
+
From the [http://www.sqlite.org/ project home page]:
SQLite's homepage is: http://www.sqlite.org/
+
: ''SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.''
  
===Features===
+
== Features ==
From: http://www.sqlite.org/features.html
+
    Transactions are atomic, consistent, isolated, and durable even after system crashes and power failures.
+
    Zero-configuration - no setup or administration needed.
+
    Implements most of SQL92.
+
    A complete database is stored in a single cross-platform disk file.
+
    Supports terabyte-sized databases and gigabyte-sized strings and blobs.
+
    Small code footprint: less than 325KiB fully configured or less than 190KiB with optional features omitted.
+
    Faster than popular client/server database engines for most common operations.
+
    Simple, easy to use API.
+
    Written in ANSI-C. TCL bindings included. Bindings for dozens of other languages available separately.
+
    Well-commented source code with 100% branch test coverage.
+
    Available as a single ANSI-C source-code file that you can easily drop into another project.
+
    Self-contained: no external dependencies.
+
    Cross-platform: Unix (Linux and Mac OS X), OS/2, and Windows (Win32 and WinCE) are supported out of the box. Easy to port to other systems.
+
    Sources are in the public domain. Use for any purpose.
+
    Comes with a standalone command-line interface (CLI) client that can be used to administer SQLite databases.
+
  
===Installation===
+
From: [http://www.sqlite.org/features.html SQLite Features]
<b>pacman -S sqlite3</b>
+
* Transactions are atomic, consistent, isolated, and durable even after system crashes and power failures.
 +
* Zero-configuration - no setup or administration needed.
 +
* Implements most of SQL92.
 +
* A complete database is stored in a single cross-platform disk file.
 +
* Supports terabyte-sized databases and gigabyte-sized strings and blobs.
 +
* Small code footprint: less than 325KiB fully configured or less than 190KiB with optional features omitted.
 +
* Faster than popular client/server database engines for most common operations.
 +
* Simple, easy to use API.
 +
* Written in ANSI-C. TCL bindings included. Bindings for dozens of other languages available separately.
 +
* Well-commented source code with 100% branch test coverage.
 +
* Available as a single ANSI-C source-code file that you can easily drop into another project.
 +
* Self-contained: no external dependencies.
 +
* Cross-platform: Unix (Linux and Mac OS X), OS/2, and Windows (Win32 and WinCE) are supported out of the box. Easy to port to other systems.
 +
* Sources are in the public domain. Use for any purpose.
 +
* Comes with a standalone command-line interface (CLI) client that can be used to administer SQLite databases.
  
===Related Packages===
+
== Installation ==
    core/sqlite3-doc
+
 
    most of the static HTML files that comprise this website, including all of the SQL Syntax and the C/C++ interface specs and other
+
[[pacman|Install]] {{Pkg|sqlite}} from the [[official repositories]].
    miscellaneous documentation
+
 
   
+
Related packages are:
    extra/php-sqlite
+
* {{Pkg|sqlite-doc}} - most of the static HTML files that comprise this website, including all of the SQL Syntax and the C/C++ interface specs and other miscellaneous documentation
    sqlite3 module for PHP
+
* {{Pkg|php-sqlite}} - sqlite3 module for PHP (don't forget to enable it in /etc/php/php.ini)
   
+
* {{Pkg|gambas2-gb-db-sqlite3}} - Gambas2 Sqlite3 database access component
    community/gambas2-gb-db-sqlite3
+
* {{Pkg|sqliteman}} - The best developer's and/or admin's GUI tool for Sqlite3 in the world
    Gambas2 Sqlite3 database access component
+
 
   
+
== Using sqlite3 command line shell ==
    community/sqliteman
+
    The best developer's and/or admin's GUI tool for Sqlite3 in the world
+
  
===Using sqlite3 command line shell===
 
 
The SQLite library includes a simple command-line utility named sqlite3 that allows the user to manually enter and execute SQL commands against an SQLite database.
 
The SQLite library includes a simple command-line utility named sqlite3 that allows the user to manually enter and execute SQL commands against an SQLite database.
  
  <b>Create a database</b>
+
==== Create a database ====
    sqlite3 archdatabase
+
 
 +
sqlite3 ''databasename''
 +
 
 +
==== Create table ====
 +
 
 +
sqlite> create table tblone(one varchar(10), two smallint);
 +
 
 +
==== Insert data ====
 +
 
 +
sqlite> insert into tblone values('helloworld',20);
 +
sqlite> insert into tblone values('archlinux', 30);
 +
 
 +
==== Search database ====
 +
 
 +
sqlite> select * from tblone;
 +
helloworld|20
 +
rchlinux|30
  
  <b>Create Table</b>
+
See the [http://www.sqlite.org/sqlite.html sqlite docs].
    sqlite> create table tblone(one varchar(10), two smallint);
+
 
+
  <b>Insert Data</b>
+
    sqlite> insert into tblone values('helloworld',20);
+
    sqlite> insert into tblone values('archlinux', 30);
+
  
  <b>Search Database</b>
+
== Using sqlite in shell script ==
    sqlite> select * from tblone;
+
    helloworld|20
+
    archlinux|30
+
  
See the sqlite docs: http://www.sqlite.org/sqlite.html
+
See forum [https://bbs.archlinux.org/viewtopic.php?id=109802 post].
  
===Using sqlite in shell script===
+
== ESee also ==
See forum post: https://bbs.archlinux.org/viewtopic.php?id=109802
+
  
===External Links===
+
* [http://www.sqlite.org SQLite homepage]
http://www.squidoo.com/sqlitehammer<br>
+
* [http://www.squidoo.com/sqlitehammer SQLite Hammer]
[http://oreilly.com/catalog/9780596521196 Using SQLite - Oreilly Book]<br>
+
* [http://oreilly.com/catalog/9780596521196 Using SQLite - Oreilly Book]
[http://www.amazon.com/Definitive-Guide-SQLite-Mike-Owens/dp/1590596730 SQLITE - Apress Book]<br>
+
* [http://www.amazon.com/Definitive-Guide-SQLite-Mike-Owens/dp/1590596730 SQLite - Apress Book]

Revision as of 12:40, 22 June 2013


From the project home page:

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.

Features

From: SQLite Features

  • Transactions are atomic, consistent, isolated, and durable even after system crashes and power failures.
  • Zero-configuration - no setup or administration needed.
  • Implements most of SQL92.
  • A complete database is stored in a single cross-platform disk file.
  • Supports terabyte-sized databases and gigabyte-sized strings and blobs.
  • Small code footprint: less than 325KiB fully configured or less than 190KiB with optional features omitted.
  • Faster than popular client/server database engines for most common operations.
  • Simple, easy to use API.
  • Written in ANSI-C. TCL bindings included. Bindings for dozens of other languages available separately.
  • Well-commented source code with 100% branch test coverage.
  • Available as a single ANSI-C source-code file that you can easily drop into another project.
  • Self-contained: no external dependencies.
  • Cross-platform: Unix (Linux and Mac OS X), OS/2, and Windows (Win32 and WinCE) are supported out of the box. Easy to port to other systems.
  • Sources are in the public domain. Use for any purpose.
  • Comes with a standalone command-line interface (CLI) client that can be used to administer SQLite databases.

Installation

Install sqlite from the official repositories.

Related packages are:

  • sqlite-doc - most of the static HTML files that comprise this website, including all of the SQL Syntax and the C/C++ interface specs and other miscellaneous documentation
  • php-sqlite - sqlite3 module for PHP (don't forget to enable it in /etc/php/php.ini)
  • gambas2-gb-db-sqlite3 - Gambas2 Sqlite3 database access component
  • sqliteman - The best developer's and/or admin's GUI tool for Sqlite3 in the world

Using sqlite3 command line shell

The SQLite library includes a simple command-line utility named sqlite3 that allows the user to manually enter and execute SQL commands against an SQLite database.

Create a database

sqlite3 databasename

Create table

sqlite> create table tblone(one varchar(10), two smallint);

Insert data

sqlite> insert into tblone values('helloworld',20);
sqlite> insert into tblone values('archlinux', 30);

Search database

sqlite> select * from tblone;
helloworld|20
rchlinux|30

See the sqlite docs.

Using sqlite in shell script

See forum post.

ESee also