sqlite_server/inc/litedb.h
2025-03-15 04:05:49 -04:00

46 lines
702 B
C++

#pragma once
#include <string>
#include <status.h>
#include <sqlite3.h>
#include <vector>
#include <entry.h>
class litedb
{
private:
std::string _db_path_name;
sqlite3 *db;
sqlite3_stmt *stmt;
litedb(const litedb &oth) = delete;
litedb &operator=(const litedb &oth) = delete;
const static std::string SQL_TEXT_FETCH_ALL_TABLE_NAME;
public:
litedb(std::string &db_name);
Status litedb_open();
inline bool is_db_open() const
{
return this->db ? true : false;
}
inline sqlite3* get_db_handler(){
return this->db;
}
Status exec_sql(std::string&& sql);
Status exec_prepare_sql(std::string&& sql);
~litedb();
};