25 lines
727 B
C++
25 lines
727 B
C++
#pragma once
|
|
#ifndef WIN32
|
|
#include <sqlite/sqlite3.h>
|
|
#include <memory>
|
|
#include "lib/utils/bts_export.h"
|
|
|
|
typedef struct sqlite3 sqlite3;
|
|
typedef struct sqlite3_stmt sqlite3_stmt;
|
|
typedef std::unique_ptr<sqlite3, int(*)(sqlite3*)> sqlite3_ptr;
|
|
typedef std::unique_ptr<sqlite3_stmt, int(*)(sqlite3_stmt*)> sqlite3_stmt_ptr;
|
|
|
|
namespace bts {
|
|
namespace utils {
|
|
|
|
BTS_EXPORT void sqlite3_exec_nofail(sqlite3* db, const char* sql);
|
|
BTS_EXPORT void sqlite3_exec_nofail(sqlite3_ptr& db, const char* sql);
|
|
|
|
BTS_EXPORT sqlite3_ptr open_db(const char* path);
|
|
BTS_EXPORT sqlite3_stmt_ptr prepare_query(sqlite3* db, const char* query);
|
|
BTS_EXPORT sqlite3_stmt_ptr prepare_query(sqlite3_ptr& db, const char* query);
|
|
#endif
|
|
|
|
}}//namespace
|
|
|