mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* let clang-tidy do its thing * Automated clang-tidy change: modernize-use-override * compile test --------- Co-authored-by: Clang Tidy <clang-tidy@users.noreply.github.com>
69 lines
2 KiB
C++
69 lines
2 KiB
C++
/** @file
|
|
*
|
|
* @par History
|
|
*/
|
|
|
|
|
|
#ifndef SQLMOD_H
|
|
#define SQLMOD_H
|
|
|
|
#include <string>
|
|
|
|
#include "../polmodl.h"
|
|
#include "../uoexec.h"
|
|
|
|
namespace Pol
|
|
{
|
|
namespace Bscript
|
|
{
|
|
class BObjectImp;
|
|
class Executor;
|
|
class ObjArray;
|
|
} // namespace Bscript
|
|
namespace Core
|
|
{
|
|
class UOExecutor;
|
|
} // namespace Core
|
|
} // namespace Pol
|
|
template <class T>
|
|
class weak_ptr;
|
|
|
|
namespace Pol
|
|
{
|
|
namespace Core
|
|
{
|
|
class BSQLConnection;
|
|
}
|
|
namespace Module
|
|
{
|
|
class SQLExecutorModule : public Bscript::TmplExecutorModule<SQLExecutorModule, Core::PolModule>
|
|
{
|
|
public:
|
|
SQLExecutorModule( Bscript::Executor& exec );
|
|
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_connect();
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_query();
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_close();
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_num_fields();
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_affected_rows();
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_fetch_row();
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_num_rows();
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_select_db();
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_field_name();
|
|
[[nodiscard]] Bscript::BObjectImp* mf_mysql_escape_string();
|
|
|
|
static Bscript::BObjectImp* background_connect( weak_ptr<Core::UOExecutor> uoexec,
|
|
const std::string host,
|
|
const std::string username,
|
|
const std::string password, int port );
|
|
static Bscript::BObjectImp* background_select( weak_ptr<Core::UOExecutor> uoexec,
|
|
Core::BSQLConnection* sql, const std::string db );
|
|
static Bscript::BObjectImp* background_query( weak_ptr<Core::UOExecutor> uoexec,
|
|
Core::BSQLConnection* sql, const std::string query,
|
|
const Bscript::ObjArray* params );
|
|
|
|
size_t sizeEstimate() const override;
|
|
};
|
|
} // namespace Module
|
|
} // namespace Pol
|
|
#endif
|