1 /* Simple SQL-style database ops. Currently implemented for sqlite3. */
2 //#ifndef _UPLOAD_ANALYSIS_DATABASE_H
3 //#define _UPLOAD_ANALYSIS_DATABASE_H
6 /* Returns handle to the database.. */
7 void *db_open(const char *file);
9 /* Runs query (SELECT). Fills in columns. */
12 unsigned int num_rows;
16 struct db_query *db_query(void *h, const char *query);
18 /* Runs command (CREATE TABLE/INSERT) */
19 void db_command(void *h, const char *command);
21 /* Starts transaction. Doesn't need to nest. */
22 //void db_transaction_start(void *h);
24 /* Finishes transaction, or rolls it back and caller needs to start again. */
25 //bool db_transaction_finish(void *h);
27 /* Closes database (only called when everything OK). */
28 void db_close(void *h);
30 //#endif /* _UPLOAD_ANALYSIS_DATABASE_H */