SQLite

Java Integration

 * http://stackoverflow.com/questions/41233/java-and-sqlite
 * http://www.zentus.com/sqlitejdbc/
 * http://blog.rungeek.com/post/81611917/how-to-use-sqlite-with-java
 * http://code.google.com/p/sqlite4java/
 * http://code.google.com/p/sqlite4java/wiki/ComparisonToOtherWrappers
 * http://www.ch-werner.de/javasqlite/

iOS
-com.apple.CoreData.SQLDebug 1

Bash Integration
sqlite3 test.db "select * from n";
 * http://mailliststock.wordpress.com/2007/03/01/sqlite-examples-with-bash-perl-and-python/

General Information
CREATE TABLE track( id        INTEGER PRIMARY KEY AUTOINCREMENT,   name      TEXT,   artist_id INTEGER,  FOREIGN KEY(artist_id) REFERENCES artist(id) ); alter table tag rename to project_tag;
 * http://www.sqlite.org/sitemap.html
 * http://www.sqlite.org/sqlite.html
 * http://www.sqlite.org/datatype3.html
 * http://www.sqlite.org/lang.html
 * http://www.sqlite.org/foreignkeys.html
 * http://www.sqlite.org/lang_altertable.html

Data Dictionary
select * from sqlite_master; sqlite> .tables sqlite> .schema sqlite> .dump sqlite> .explain

SQL
* http://www.sqlite.org/foreignkeys.html

Tables
create table project { id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(32) );
 * http://www.mail-archive.com/sqlite-users@sqlite.org/msg10420.html

Tricks
Copy a database $ echo '.dump' | sqlite3 ex1 | gzip -c >ex1.dump.gz ... $ zcat ex1.dump.gz | sqlite3 ex2 The text format is pure SQL so you can also use the .dump command to export an SQLite database into other popular SQL database engines. Like this: $ createdb ex2 $ sqlite3 ex1 .dump | psql ex2
 * http://www.sqlite.org/sqlite.html

Parameterized
symbol = 'IBM' c.execute("... where symbol = '%s'" % symbol)
 * http://programmingzen.com/2009/09/09/improve-the-speed-and-security-of-your-sql-queries/
 * http://stackoverflow.com/questions/474261/python-pysqlite-not-accepting-my-qmark-parameterization
 * http://pysqlite.googlecode.com/svn/doc/sqlite3.html
 * http://www.velocityreviews.com/forums/t595019-pysqlite-insert-speed.html
 * http://www.cesarkallas.net/arquivos/apostilas/python/exemplos/pysqlite%20usage%20guide.htm
 * http://www.computerworld.com/s/article/9137478/Opinion_No_more_excuses_for_SQL_injection_attacks
 * 1) Never do this -- insecure!

t = (symbol,) c.execute('select * from stocks where symbol=?', t)
 * 1) Do this instead

for t in [('2006-03-28', 'BUY', 'IBM', 1000, 45.00), ('2006-04-05', 'BUY', 'MSOFT', 1000, 72.00), ('2006-04-06', 'SELL', 'IBM', 500, 53.00), ]:   c.execute('insert into stocks values (?,?,?,?,?)', t)
 * 1) Larger example