Lines Matching defs:db
290 snprintf(path, sizeof(path), "%s/files.db", db_path);
296 if (sqlite3_open(path, &db) != SQLITE_OK)
299 *sq3 = db;
300 sqlite3_busy_timeout(db, 5000);
301 sql_exec(db, "pragma page_size = 4096");
302 sql_exec(db, "pragma journal_mode = OFF");
303 sql_exec(db, "pragma synchronous = OFF;");
304 sql_exec(db, "pragma default_cache_size = 8192;");
310 check_db(sqlite3 *db, int new_db, pid_t *scanner_pid)
324 ret = sql_get_int_field(db, "SELECT TIMESTAMP from DETAILS where PATH = %Q", media_path->path);
333 sql_get_table(db, "SELECT VALUE from SETTINGS where KEY = 'media_dir'", &result, &rows, NULL);
353 ret = db_upgrade(db);
360 DPRINTF(E_WARN, L_GENERAL, "Creating new database at %s/files.db\n", db_path);
368 sqlite3_close(db);
370 snprintf(cmd, sizeof(cmd), "rm -rf %s/files.db %s/art_cache", db_path, db_path);
374 open_db(&db);
379 sqlite3_close(db);
381 open_db(&db);
385 sqlite3_close(db);
848 snprintf(buf, sizeof(buf), "rm -rf %s/files.db %s/art_cache", db_path, db_path);
1057 updateID = sql_get_int_field(db, "SELECT VALUE from SETTINGS where KEY = 'UPDATE_ID'");
1061 check_db(db, ret, &scanner_pid);
1093 ret = sqlite3_create_function(db, "tivorandom", 1, SQLITE_UTF8, NULL, &TiVoRandomSeedFunc, NULL, NULL);
1251 if (scanning || sqlite3_total_changes(db) != last_changecnt)
1254 last_changecnt = sqlite3_total_changes(db);
1354 sql_exec(db, "UPDATE SETTINGS set VALUE = '%u' where KEY = 'UPDATE_ID'", updateID);
1355 sqlite3_close(db);