2021-12-05 18:54:36 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// C++
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
// SQLite
|
|
|
|
#include "CppSQLite3.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Optimization settings
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
#include <iostream>
|
|
|
|
|
2023-08-10 21:27:40 -07:00
|
|
|
//! The CDClient Database namespace
|
2021-12-05 18:54:36 +01:00
|
|
|
namespace CDClientDatabase {
|
2022-07-28 08:39:57 -05:00
|
|
|
|
2021-12-05 18:54:36 +01:00
|
|
|
//! Opens a connection with the CDClient
|
|
|
|
/*!
|
|
|
|
\param filename The filename
|
|
|
|
*/
|
|
|
|
void Connect(const std::string& filename);
|
2022-07-28 08:39:57 -05:00
|
|
|
|
2021-12-05 18:54:36 +01:00
|
|
|
//! Queries the CDClient
|
|
|
|
/*!
|
|
|
|
\param query The query
|
|
|
|
\return The results of the query
|
|
|
|
*/
|
|
|
|
CppSQLite3Query ExecuteQuery(const std::string& query);
|
2022-07-28 08:39:57 -05:00
|
|
|
|
2022-10-30 00:38:43 -07: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);
|
|
|
|
|
2022-01-05 21:52:33 -05:00
|
|
|
//! Queries the CDClient and parses arguments
|
|
|
|
/*!
|
|
|
|
\param query The query with formatted arguments
|
2022-01-12 22:48:27 -05:00
|
|
|
\return prepared SQLite Statement
|
2022-01-05 21:52:33 -05:00
|
|
|
*/
|
2022-01-12 22:48:27 -05:00
|
|
|
CppSQLite3Statement CreatePreppedStmt(const std::string& query);
|
2021-12-05 18:54:36 +01:00
|
|
|
};
|