SQLite

WebHome | UnixGeekTools | Geekfarm | About This Site

pointers

features

SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. Features include:

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.

data types

examples

    sqlite filename.db
    > CREATE TABLE test1 ( a INTEGER UNIQUE, b REAL, c TEXT );
    > .help
    > .tables
    > .schema
    > insert into test1 (keys) values( 1 );
    > insert into test1 (keys) values( 3 );
    > select * from test1;
    > select * from test1 order by percent desc;
    > copy tablename from "filename" using delimiters " "
    > .quit

Dump

- generate sql statements which could be used to re-build a table or db

    # dump all
    sqlite filename.db ".dump" > ~/tmp/table.sql

    # dump a specific table
    sqlite filename.db ".dump <table>" > ~/tmp/table.sql

problems

gui

JDBC

    jdbc:sqlite://dirA/dirB/dbfile
    jdbc:sqlite:/DRIVE:/dirA/dirB/dbfile
    jdbc:sqlite:///COMPUTERNAME/shareA/dirB/dbfile

problems building on osx!!! :(

someone suggested something like this:

    ./configure --with-jdk=/System/Library/Frameworks/JavaVM.framework/Home
    make
    cp .libs/libsqlite_jni.dylib libsqlite_jni.jnilib

freebsd

    -I/usr/local/jdk1.4.2/include/freebsd -I/usr/local/jdk1.4.2/include/





Updated Tue May 8, 2007 5:09 PM