mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-25 06:53:35 +00:00
4a50c60559
* Assorted pet improvements * remove unecessary include * updates to address some feedback * fixed database code for testing * Removed reference member (for now) * Removed cmake flag
30 lines
848 B
C++
30 lines
848 B
C++
#include "CDClientDatabase.h"
|
|
#include "CDComponentsRegistryTable.h"
|
|
|
|
// Static Variables
|
|
static CppSQLite3DB* conn = new CppSQLite3DB();
|
|
|
|
// Status Variables
|
|
bool CDClientDatabase::isConnected = false;
|
|
|
|
//! Opens a connection with the CDClient
|
|
void CDClientDatabase::Connect(const std::string& filename) {
|
|
conn->open(filename.c_str());
|
|
isConnected = true;
|
|
}
|
|
|
|
//! Queries the CDClient
|
|
CppSQLite3Query CDClientDatabase::ExecuteQuery(const std::string& query) {
|
|
return conn->execQuery(query.c_str());
|
|
}
|
|
|
|
//! Updates the CDClient file with Data Manipulation Language (DML) commands.
|
|
int CDClientDatabase::ExecuteDML(const std::string& query) {
|
|
return conn->execDML(query.c_str());
|
|
}
|
|
|
|
//! Makes prepared statements
|
|
CppSQLite3Statement CDClientDatabase::CreatePreppedStmt(const std::string& query) {
|
|
return conn->compileStatement(query.c_str());
|
|
}
|