DarkflameServer/dDatabase/CDClientDatabase/CDClientDatabase.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.1 KiB
C
Raw Permalink Normal View History

#pragma once
// C++
#include <string>
// SQLite
#include "CppSQLite3.h"
/*
* Optimization settings
*/
#include <sstream>
#include <iostream>
//! The CDClient Database namespace
namespace CDClientDatabase {
/**
* Boolean defining the connection status of CDClient
*/
extern bool isConnected;
2022-07-28 13:39:57 +00:00
//! Opens a connection with the CDClient
/*!
\param filename The filename
*/
void Connect(const std::string& filename);
2022-07-28 13:39:57 +00:00
//! Queries the CDClient
/*!
\param query The query
\return The results of the query
*/
CppSQLite3Query ExecuteQuery(const std::string& query);
2022-07-28 13:39:57 +00:00
//! Updates the CDClient file with Data Manipulation Language (DML) commands.
/*!
\param query The DML command to run. DML command can be multiple queries in one string but only
the last one will return its number of updated rows.
\return The number of updated rows.
*/
int ExecuteDML(const std::string& query);
//! Queries the CDClient and parses arguments
/*!
\param query The query with formatted arguments
\return prepared SQLite Statement
*/
CppSQLite3Statement CreatePreppedStmt(const std::string& query);
};