This is an old revision of the document!


SQLite command-line utility

Introduction

Starting with POPFile version 0.21.0, POPFile uses a SQLite database to store the POPFile corpus, magnets and other data. POPFile's SQLite database is a single file, usually named popfile.db. At first POPFile used SQLite version 2.x databases but with the 1.1.0 release it switched to the newer SQLite version 3.x format for the database.

The Windows version of POPFile comes with a simple SQLite command-line utility. The Windows POPFile installer creates a shortcut (“Run SQLite utility”) in the 'User Data' folder to make it easy to use the SQLite command-line utility. The utility runs in a Command Prompt window. You must type the necessary commands into this window to make the utility do anything. The Windows POPFile installer provides some user-friendly front-end utilities you can use rather than having to memorize all of the command syntax:

  • POPFile SQLite Database Status Check utility
  • POPFile Run SQLite Utility

SQLite 2.x and 3.x databases are not compatible therefore POPFile 1.1.0 (or later) will automatically upgrade an existing SQLite 2.x database to the new 3.x format (and save the old database as popfile.db.backup). There are also two versions of the SQLite command-line utility: sqlite3.exe works with SQLite 3.x format databases and sqlite.exe works with SQLite 2.x databases.

The shortcuts created by the Windows installer will automatically use the appropriate version of the SQLite command-line utility.

Two common uses for the SQLite command-line utility are: checking the integrity of an SQLite database, and defragmenting an SQLite database. The utility also allows advanced users to manually enter and execute SQL commands to manipulate an SQLite database.

sqlite3.exe (for use with POPFile 1.1.0 or later)

A tutorial showing how to use this utility is on the SQLite website. Note that this tutorial is for the SQLite 3.x version of the command-line utility (i.e. it applies to POPFile 1.1.0 or later).

CAUTION: Although the SQLite web site describes the SQLite command-line utility as a “simple” utility, it is actually very powerful. If you use it incorrectly, you could seriously damage the POPFile database, preventing POPFile from working properly.

sqlite.exe (for use with POPFile 0.21.0 to 1.0.1)

NOTE: Binary versions of the SQLite command-line utility which are compatible with SQLite 2.x format databases as used by POPFile 0.21.0 to 1.0.1 are no longer listed on the SQLite download page though the source code for SQLite 2.8 is still available.

If you want to know more about the POPFile-compatible version of the SQLite command-line utility, a tutorial based on old information from the SQLite web site, is available here.

CAUTION: Although the SQLite web site describes the SQLite command-line utility as a “simple” utility, it is actually very powerful. If you use it incorrectly, you could seriously damage the POPFile database, preventing POPFile from working properly.

 
howtos/sqlitecommandlineutility.1236518902.txt.gz · Last modified: 2009/03/08 14:28 by xuesheng

Should you find anything in the documentation that is incomplete, unclear, outdated or just plain wrong, please let us know and leave a note in the Documentation Forum.

Recent changes RSS feed Donate Driven by DokuWiki
The content of this wiki is protected by the GNU Fee Documentation License