SQLite 3.3.8 review
DownloadSQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. Here are some ke
|
|
SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.
Here are some key features of "SQLite":
Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures.
Zero-configuration - no setup or administration needed.
Implements most of SQL92. (Features not supported)
A complete database is stored in a single disk file.
Database files can be freely shared between machines with different byte orders.
Supports databases up to 2 terabytes (241 bytes) in size.
Sizes of strings and BLOBs limited only by available memory.
Small code footprint: less than 30K lines of C code, less than 250KB code space (gcc on 486)
Faster than popular client/server database engines for most common operations.
Simple, easy to use API.
TCL bindings included. Bindings for many other languages available separately.
Well-commented source code with over 95% test coverage.
Self-contained: no external dependencies.
Sources are in the public domain. Use for any purpose.
The SQLite distribution comes with a standalone command-line access program (sqlite) that can be used to administer an SQLite database and which serves as an example of how to use the SQLite library.
Create A New Database:
At a shell or DOS prompt, enter: "sqlite3 test.db". This will create a new database named "test.db". (You can use a different name if you like.)
Enter SQL commands at the prompt to create and populate the new database.
Write Programs That Use SQLite
Below is a simple TCL program that demonstrates how to use the TCL interface to SQLite. The program executes the SQL statements given as the second argument on the database defined by the first argument. The commands to watch for are the sqlite3 command on line 7 which opens an SQLite database and creates a new TCL command named "db" to access that database, the invocation of the db command on line 8 to execute SQL commands against the database, and the closing of the database connection on the last line of the script.
#!/usr/bin/tclsh
if {$argc!=2} {
puts stderr "Usage: %s DATABASE SQL-STATEMENT"
exit 1
}
load /usr/lib/tclsqlite3.so Sqlite3
sqlite3 db [lindex $argv 0]
db eval [lindex $argv 1] x {
foreach v $x(*) {
puts "$v = $x($v)"
}
puts ""
}
db close
SQLite 3.3.8 search tags