2020-11-28 14:30:50 +01:00
|
|
|
#ifndef SQLITE3_CONNECTION
|
|
|
|
#define SQLITE3_CONNECTION
|
|
|
|
|
2021-05-15 13:54:28 +02:00
|
|
|
#include "core/database/database.h"
|
2020-12-01 14:53:32 +01:00
|
|
|
|
2020-11-28 14:30:50 +01:00
|
|
|
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
|
|
|
//later this will be fixed better
|
|
|
|
//#ifdef IS_NUM
|
|
|
|
//#undef IS_NUM
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
2021-05-01 23:35:37 +02:00
|
|
|
#include "./sqlite/sqlite3.h"
|
2020-11-28 14:30:50 +01:00
|
|
|
|
2020-12-01 14:56:05 +01:00
|
|
|
class SQLite3Database : public Database {
|
2020-11-28 14:30:50 +01:00
|
|
|
public:
|
2020-12-01 15:28:59 +01:00
|
|
|
static Database *_creation_func();
|
|
|
|
static void _register();
|
|
|
|
static void _unregister();
|
2020-12-01 14:53:32 +01:00
|
|
|
|
2021-11-01 16:57:22 +01:00
|
|
|
Ref<QueryBuilder> get_query_builder();
|
|
|
|
Ref<TableBuilder> get_table_builder();
|
2021-08-19 22:18:11 +02:00
|
|
|
|
2021-05-01 20:31:52 +02:00
|
|
|
void connect(const std::string &connection_str);
|
2021-11-01 16:57:22 +01:00
|
|
|
Ref<QueryResult> query(const std::string &query);
|
2021-05-01 20:31:52 +02:00
|
|
|
void query_run(const std::string &query);
|
2020-11-28 14:30:50 +01:00
|
|
|
|
2021-07-08 18:52:59 +02:00
|
|
|
std::string escape(const std::string str);
|
|
|
|
void escape(const std::string str, std::string *to);
|
|
|
|
|
2021-05-01 20:31:52 +02:00
|
|
|
SQLite3Database();
|
|
|
|
~SQLite3Database();
|
2020-11-28 14:30:50 +01:00
|
|
|
|
|
|
|
sqlite3 *conn;
|
|
|
|
};
|
|
|
|
|
|
|
|
//#undef IS_NUM
|
|
|
|
|
|
|
|
#endif
|