10 * A simple check to test if a table exists
13 gboolean db_check(sqlite3 *db, const gchar *table)
19 snprintf(sql, sizeof(sql),"select count(*) from %s", table);
21 if (SQLITE_OK != sqlite3_get_table(db, sql, &pszResult, &nRow, &nColumn, NULL))
24 sqlite3_free_table(pszResult);
29 * Close the database connection
32 gboolean db_close(sqlite3 **db)
42 * Connect to given sqlite database
45 gboolean db_connect(sqlite3 **ndb, const gchar *db_file)
49 printf("%s()\n", __PRETTY_FUNCTION__);
64 if (SQLITE_OK != (sqlite3_open(db_file, &db))) {
73 printf("%s(): return\n", __PRETTY_FUNCTION__);