return -1;
}
+#ifdef WITH_SQLITE_INDEXED
+ rc = sqlite3_exec(sqlite,
+ "CREATE INDEX idx_key "
+ "ON journal (key)"
+ ";", NULL, 0, &sqliteErr);
+ if (rc != SQLITE_OK) {
+ fprintf(stderr, "SQL Error: %s\n", sqlite3_errmsg(sqlite));
+ sqlite3_free(sqliteErr);
+ return -1;
+ }
+
+ rc = sqlite3_exec(sqlite,
+ "CREATE INDEX idx_value "
+ "ON journal (value)"
+ ";", NULL, 0, &sqliteErr);
+ if (rc != SQLITE_OK) {
+ fprintf(stderr, "SQL Error: %s\n", sqlite3_errmsg(sqlite));
+ sqlite3_free(sqliteErr);
+ return -1;
+ }
+#endif
+
rc = sqlite3_prepare(sqlite,
"INSERT INTO journal "
"(key, value, event) VALUES "