Load libsqlite dynamically

This commit is contained in:
topjohnwu
2020-01-11 03:20:59 +08:00
parent 615ad0cc5a
commit b39f407596
11 changed files with 107 additions and 12758 deletions

View File

@ -1,19 +1,11 @@
#pragma once
#include <sqlite3.h>
#include <sys/stat.h>
#include <map>
#include <string>
#include <string_view>
#include <functional>
#define db_err(e) db_err_cmd(e, )
#define db_err_cmd(e, cmd) if (e) { \
LOGE("sqlite3_exec: %s\n", e); \
sqlite3_free(e); \
cmd;\
}
template <class T, size_t num>
class db_data_base {
public:
@ -160,4 +152,6 @@ bool validate_manager(std::string &pkg, int userid, struct stat *st);
void exec_sql(int client);
char *db_exec(const char *sql);
char *db_exec(const char *sql, const db_row_cb &fn);
bool db_err(char *e);
#define db_err_cmd(e, cmd) if (db_err(e)) { cmd; }