Lines Matching defs:db
27 sql_exec(sqlite3 *db, const char *fmt, ...)
38 ret = sqlite3_exec(db, sql, 0, 0, &errMsg);
51 sql_get_table(sqlite3 *db, const char *sql, char ***pazResult, int *pnRow, int *pnColumn)
57 ret = sqlite3_get_table(db, sql, pazResult, pnRow, pnColumn, &errMsg);
69 sql_get_int_field(sqlite3 *db, const char *fmt, ...)
83 switch (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL))
88 DPRINTF(E_ERROR, L_DB_SQL, "prepare failed: %s\n%s\n", sqlite3_errmsg(db), sql);
117 DPRINTF(E_WARN, L_DB_SQL, "%s: step failed: %s\n%s\n", __func__, sqlite3_errmsg(db), sql);
128 sql_get_int64_field(sqlite3 *db, const char *fmt, ...)
142 switch (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL))
147 DPRINTF(E_ERROR, L_DB_SQL, "prepare failed: %s\n%s\n", sqlite3_errmsg(db), sql);
176 DPRINTF(E_WARN, L_DB_SQL, "%s: step failed: %s\n%s\n", __func__, sqlite3_errmsg(db), sql);
187 sql_get_text_field(sqlite3 *db, const char *fmt, ...)
195 if (db == NULL)
197 DPRINTF(E_WARN, L_DB_SQL, "db is NULL\n");
207 switch (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL))
212 DPRINTF(E_ERROR, L_DB_SQL, "prepare failed: %s\n%s\n", sqlite3_errmsg(db), sql);
253 DPRINTF(E_WARN, L_DB_SQL, "SQL step failed: %s\n", sqlite3_errmsg(db));
263 db_upgrade(sqlite3 *db)
267 db_vers = sql_get_int_field(db, "PRAGMA user_version");
277 sql_exec(db, "PRAGMA user_version = %d", DB_VERSION);