mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 13:37:22 +00:00
3de3932503
Remove the CDClientDatabase::ExecuteQueryWithArgs() function and replace it with CDClientDatabase::CreatePreppedStmt(). This prevents a developer from accidently using %s, or incorrectly passing std::string, and causing a silent error.
21 lines
592 B
C++
21 lines
592 B
C++
#include "CDClientDatabase.h"
|
|
#include "CDComponentsRegistryTable.h"
|
|
|
|
// Static Variables
|
|
static CppSQLite3DB * conn = new CppSQLite3DB();
|
|
|
|
//! Opens a connection with the CDClient
|
|
void CDClientDatabase::Connect(const std::string& filename) {
|
|
conn->open(filename.c_str());
|
|
}
|
|
|
|
//! Queries the CDClient
|
|
CppSQLite3Query CDClientDatabase::ExecuteQuery(const std::string& query) {
|
|
return conn->execQuery(query.c_str());
|
|
}
|
|
|
|
//! Makes prepared statements
|
|
CppSQLite3Statement CDClientDatabase::CreatePreppedStmt(const std::string& query) {
|
|
return conn->compileStatement(query.c_str());
|
|
}
|