|
SQLite 3.5.7 and SQLite librariesSQLite is a simple SQL database engine. According to the SQLite homepage it 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. It is used in countless desktop computer applications as well as consumer electronic devices including cellphones, PDAs, and MP3 players. The source code for SQLite is in the public domain".In addition, sqlite libraries are callable from Python
Using the Software
% sqlite3 test.db
SQLite version 3.5.7
Enter ".help" for instructions
sqlite>sqlite> create table t1 (t1key INTEGER PRIMARY KEY,data TEXT,num
double,timeEnter DATE);
sqlite> insert into t1 (data,num) values ('This is sample data',3);
sqlite> insert into t1 (data,num) values ('More sample data',6);
sqlite> insert into t1 (data,num) values ('And a little more',9);
sqlite> select * from t1;
1|This is sample data|3.0|
2|More sample data|6.0|
3|And a little more|9.0|
sqlite>.quit
Here is an example of calling sqlite libraries from a simple python2.5
program named "test-sql.py":
import sqlite3, sys
dbname = 'test1.db'
con = sqlite3.connect(dbname)
cur = con.cursor()
cur.execute('create table if not exists t (a, b, c)')
ll = [{'a':1,'b':2,'c':3},{'a':4,'b':5,'c':6}]
cur.executemany('insert into t (a, b, c) values (:a, :b, :c)', ll)
con.commit()
cur.execute('select * from t')
print sys.version
print 'contents of %s: ' % dbname
print cur.fetchall()
and you invoke it as follows:
%python2.5 test-sql.py
Documentation
$ sqlite3
SQLite version 3.5.7
Enter ".help" for instructions
sqlite> .help
Technical Support
|
||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||