Lines Matching refs:db
21 void exec(sqlite3 *db, char *sql) in exec() argument
25 int rc = sqlite3_exec(db, sql, NULL, NULL, &errmsg); in exec()
31 void query(sqlite3 *db, char *sql) in query() argument
35 int rc = sqlite3_exec(db, sql, callback, NULL, &errmsg); in query()
42 void query_test(sqlite3 *db, const char *args) in query_test() argument
45 exec(db, "create table user(" in query_test()
58 exec(db, cmd); in query_test()
61 query(db, "select * from user"); in query_test()
64 query(db, "select * from user where id = 2"); in query_test()
69 sqlite3 *db; in memory() local
71 int ret = sqlite3_open(":memory:", &db); in memory()
74 query_test(db, "memory"); in memory()
79 sqlite3 *db; in file() local
80 int ret = sqlite3_open("file.sqlite", &db); in file()
88 query_test(db, "file"); in file()
89 sqlite3_close(db); in file()