2020-05-05 09:42:02 +00:00
|
|
|
#ifndef CORE_DATABASE_H
|
|
|
|
#define CORE_DATABASE_H
|
|
|
|
|
|
|
|
#include <sqlite3.h>
|
|
|
|
|
2020-09-03 22:28:49 +00:00
|
|
|
typedef int database_transaction_lock;
|
|
|
|
|
2020-05-05 09:42:02 +00:00
|
|
|
extern sqlite3 *global_database;
|
|
|
|
|
2020-08-15 10:13:03 +00:00
|
|
|
void
|
|
|
|
database_init();
|
|
|
|
|
|
|
|
void
|
|
|
|
database_free();
|
|
|
|
|
2020-08-21 12:03:23 +00:00
|
|
|
void
|
2020-05-05 09:42:02 +00:00
|
|
|
database_migrate();
|
|
|
|
|
2020-08-15 10:13:03 +00:00
|
|
|
|
2020-09-03 22:28:49 +00:00
|
|
|
void
|
|
|
|
database_transaction_begin(database_transaction_lock *lock);
|
2020-08-15 10:13:03 +00:00
|
|
|
|
|
|
|
void
|
2020-09-03 22:28:49 +00:00
|
|
|
database_transaction_commit(database_transaction_lock *lock);
|
2020-08-15 10:13:03 +00:00
|
|
|
|
|
|
|
void
|
2020-09-03 22:28:49 +00:00
|
|
|
database_transaction_rollback(database_transaction_lock *lock);
|
2020-08-15 10:13:03 +00:00
|
|
|
|
2020-08-15 11:10:17 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
database_helper_get_id(sqlite3_stmt *stmt);
|
|
|
|
|
|
|
|
int*
|
|
|
|
database_helper_get_ids(sqlite3_stmt *stmt);
|
|
|
|
|
|
|
|
char*
|
|
|
|
database_helper_get_string(sqlite3_stmt *stmt);
|
|
|
|
|
|
|
|
char**
|
|
|
|
database_helper_get_strings(sqlite3_stmt *stmt);
|
|
|
|
|
2020-05-05 09:42:02 +00:00
|
|
|
#endif /* CORE_DATABASE_H */
|