User Guide - SQLite


Applicable Plans: All Standard VPS, all Advanced VPS, all Premier VPS plans

What is SQLite

SQLite is a in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. The code for SQLite is in the public domain and is thus free for use for any purpose, commercial or private. SQLite is currently found in more applications than we can count, including several high-profile projects.

SQLite is not meant to be a replacement for popular database engines like Oracle, PostgreSQL, MySQL, but it can be used to replace database text or binary files providing complete SQL database with multiple tables, indices, triggers, and views, contained in a single disk file in a cross-platform format so that you can freely copy a database between 32-bit and 64-bit systems or between big-endian and little-endian architectures.

SQLite is provided with all eApps hosting plans. If your hosting plan is using the CentOS 5 or later operating system it is part of the core package list and you do not have to install it. If you are running on a hosting plan with an operating system prior to CentOS 5 you will have to install the separate application from the Add Application area on the System tab of your Control Panel. To find out what operating system your plan is running, click on the Subscriptions icon on the My Account tab of your Control Panel, and then click on your VPS subscription. You will see the operating system at the top of the page.

Quick SQLite Intro

One of the ways to create a SQLite database is to use the command line utility provided by the sqlite3 package. For this you have to log into your VPS using SSH (please also refer to the SSH User Guide: https://support.eapps.com/hsp/ssh) and run the sqlite command to get the sqlite prompt:
 sqlite3 databasefilename.db
SQLite version 3.3.6
Enter ".help" for instructions
sqlite>
At this point you can start using SQL92 compatible SQL queries:

sqlite> create table my1sttable (name character varying (40), phone varchar(20), city varchar(20), notes text);
sqlite> insert into my1sttable (name, phone, city, notes) values ('eApps Hosting','-1-770-448-2100','Norcross/GA','eApps is a high value provider of managed hosting and related services for businesses and organizations throughout the world.');
sqlite> insert into my1sttable (name, phone, city, notes) values ('John Doe','-1-770-555-2100','NY','John - the carpenter');

sqlite> select * from my1sttable;
eApps Hosting|-1-770-448-2100|Norcross/GA|eApps is a high value provider of managed hosting and related services for businesses and organizations throughout the world.
John Doe|-1-770-555-2100|NY|John - the carpenter

sqlite> select name, phone from my1sttable;
eApps Hosting|-1-770-448-2100
John Doe|-1-770-555-2100

sqlite> select name, phone from my1sttable where name like '%John%';
John Doe|-1-770-555-2100
sqlite> .exit

Common Issues and Solutions

If you have any feedback for this section, please send it to support@eapps.com.

Links to other information

For more information about SQLite please refer to the SQLite home site: http://www.sqlite.org/ .


Comments

Please login to comment