Examples

Below are several examples of using the Seed sqlite module. For additional resources, consult the examples/ folder of the Seed source

Example 2. 

This demonstrates creating a new table, populating it, and querying it for results

sqlite = imports.sqlite;
var db = new sqlite.Database("people.db");
db.exec("create table people (key INTEGER PRIMARY KEY, name TEXT," +
                             "age INTEGER, phone TEXT);");
db.exec("insert into people(name, age, phone) " + 
                    "values('John Smith', 24, '555-123-4567');");

function cb_print_phone(results){
    Seed.print(results.phone);
}

db.exec("select from people where name='John Smith';", cb_print_phone);
db.close();