sqlite_server/inc/litedb.h

40 lines
612 B
C
Raw Normal View History

2025-03-13 20:26:17 +08:00
#pragma once
#include <string>
#include <status.h>
#include <sqlite3.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;
}
2025-03-13 21:59:22 +08:00
inline sqlite3* get_db_handler(){
return this->db;
}
Status exec_sql(std::string sql);
2025-03-13 20:26:17 +08:00
~litedb();
};
2025-03-13 21:59:22 +08:00
2025-03-13 20:26:17 +08:00