1#ifndef ENGINE_SERVER_DATABASES_CONNECTION_H
2#define ENGINE_SERVER_DATABASES_CONNECTION_H
30 virtual void ToUnixTimestamp(
const char *pTimestamp,
char *aBuf,
unsigned int BufferSize) = 0;
40 virtual const char *
Random()
const = 0;
42 virtual const char *
MedianMapTime(
char *pBuffer,
int BufferSize)
const = 0;
43 virtual const char *
False()
const = 0;
44 virtual const char *
True()
const = 0;
49 virtual bool Connect(
char *pError,
int ErrorSize) = 0;
59 virtual void BindString(
int Idx,
const char *pString) = 0;
60 virtual void BindBlob(
int Idx,
unsigned char *pBlob,
int Size) = 0;
61 virtual void BindInt(
int Idx,
int Value) = 0;
73 virtual bool Step(
bool *pEnd,
char *pError,
int ErrorSize) = 0;
77 virtual bool ExecuteUpdate(
int *pNumUpdated,
char *pError,
int ErrorSize) = 0;
84 virtual void GetString(
int Col,
char *pBuffer,
int BufferSize) = 0;
86 virtual int GetBlob(
int Col,
unsigned char *pBuffer,
int BufferSize) = 0;
89 virtual bool AddPoints(
const char *pPlayer,
int Points,
char *pError,
int ErrorSize) = 0;
95 void FormatCreateRace(
char *aBuf,
unsigned int BufferSize,
bool Backup)
const;
96 void FormatCreateTeamrace(
char *aBuf,
unsigned int BufferSize,
const char *pIdType,
bool Backup)
const;
Definition: connection.h:19
virtual bool Step(bool *pEnd, char *pError, int ErrorSize)=0
virtual bool Connect(char *pError, int ErrorSize)=0
virtual void BindInt64(int Idx, int64_t Value)=0
virtual ~IDbConnection()
Definition: connection.h:22
virtual bool ExecuteUpdate(int *pNumUpdated, char *pError, int ErrorSize)=0
void FormatCreateMaps(char *aBuf, unsigned int BufferSize) const
Definition: connection.cpp:51
virtual bool PrepareStatement(const char *pStmt, char *pError, int ErrorSize)=0
virtual int GetInt(int Col)=0
virtual void GetString(int Col, char *pBuffer, int BufferSize)=0
virtual const char * Random() const =0
IDbConnection & operator=(const IDbConnection &)=delete
virtual bool AddPoints(const char *pPlayer, int Points, char *pError, int ErrorSize)=0
char m_aPrefix[64]
Definition: connection.h:92
virtual void BindFloat(int Idx, float Value)=0
virtual void BindBlob(int Idx, unsigned char *pBlob, int Size)=0
virtual int GetBlob(int Col, unsigned char *pBuffer, int BufferSize)=0
void FormatCreateTeamrace(char *aBuf, unsigned int BufferSize, const char *pIdType, bool Backup) const
Definition: connection.cpp:34
void FormatCreateRace(char *aBuf, unsigned int BufferSize, bool Backup) const
Definition: connection.cpp:8
virtual const char * CollateNocase() const =0
virtual const char * MedianMapTime(char *pBuffer, int BufferSize) const =0
IDbConnection(const char *pPrefix)
Definition: connection.cpp:3
virtual const char * InsertTimestampAsUtc() const =0
virtual const char * InsertIgnore() const =0
virtual const char * True() const =0
virtual float GetFloat(int Col)=0
virtual void BindString(int Idx, const char *pString)=0
virtual void BindNull(int Idx)=0
virtual void Print(IConsole *pConsole, const char *pMode)=0
void FormatCreatePoints(char *aBuf, unsigned int BufferSize) const
Definition: connection.cpp:83
virtual void BindInt(int Idx, int Value)=0
virtual const char * BinaryCollate() const =0
virtual int64_t GetInt64(int Col)=0
virtual void Disconnect()=0
void FormatCreateSaves(char *aBuf, unsigned int BufferSize, bool Backup) const
Definition: connection.cpp:66
virtual void ToUnixTimestamp(const char *pTimestamp, char *aBuf, unsigned int BufferSize)=0
virtual const char * False() const =0
const char * GetPrefix() const
Definition: connection.h:27
virtual bool IsNull(int Col)=0
int MysqlInit()
Definition: mysql.cpp:35
std::unique_ptr< IDbConnection > CreateMysqlConnection(CMysqlConfig Config)
Definition: mysql.cpp:708
bool MysqlAvailable()
Definition: mysql.cpp:30
void MysqlUninit()
Definition: mysql.cpp:50
@ MAX_NAME_LENGTH_SQL
Definition: connection.h:12
std::unique_ptr< IDbConnection > CreateSqliteConnection(const char *pFilename, bool Setup)
Definition: sqlite.cpp:415
@ MAX_NAME_LENGTH
Definition: protocol.h:97
Definition: connection_pool.h:49
Definition: score.cpp:464