SQLite

From ArchWiki
Jump to: navigation, search

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.

Installation

Install the sqlite package.

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 (do not forget to enable it in /etc/php/php.ini)
  • gambas3-gb-db-sqlite3 - Gambas2 Sqlite3 database access component
  • sqlitemanAUR - Developer and/or admin GUI tool for Sqlite3
  • sqlitebrowser - DB Browser for SQLite is a high quality, visual, open source tool to create, design, and edit database files compatible with SQLite.

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
archlinux|30

See the sqlite docs.

Graphical tools

  • DB Browser for SQLite — High quality, visual, open source tool to create, design, and edit database files compatible with SQLite.
https://sqlitebrowser.org/ || sqlitebrowser

For tools supporting multiple DBMSs, see List of applications/Documents#Database tools.

Using sqlite in shell script

See forum post.

See also