public void setUp() throws Exception {
super.setUp();
db.createTable("CREATE TABLE IF NOT EXISTS table (name TEXT, count INTEGER)");
db.createIndex("CREATE UNIQUE INDEX IF NOT EXISTS names_idx ON table(name)");
db.runWriteTransaction(new ISqlJetTransaction() {
public Object run(SqlJetDb db) throws SqlJetException {
db.getTable("table").insert("XYZ", 1);
db.getTable("table").insert("XYZZ", 1);
db.getTable("table").insert("ABC", 1);
db.getTable("table").insert("ABCD", 1);
db.getTable("table").insert("ABCDEF", 1);
db.getTable("table").insert("A", 1);
return null;
}
});
db.createTable("CREATE TABLE IF NOT EXISTS noindex (id INTEGER PRIMARY KEY)");
db.runWriteTransaction(new ISqlJetTransaction() {
public Object run(SqlJetDb db) throws SqlJetException {
db.getTable("noindex").insert(1);
db.getTable("noindex").insert(2);
db.getTable("noindex").insert(3);