Skip to content

Commit

Permalink
Remove unused IDbConnection::Copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Robyt3 committed Aug 22, 2023
1 parent 5578981 commit bb14732
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions src/engine/server/databases/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class IDbConnection
IDbConnection &operator=(const IDbConnection &) = delete;
virtual void Print(IConsole *pConsole, const char *pMode) = 0;

// copies the credentials, not the active connection
virtual IDbConnection *Copy() = 0;

// returns the database prefix
const char *GetPrefix() const { return m_aPrefix; }
virtual const char *BinaryCollate() const = 0;
Expand Down
7 changes: 0 additions & 7 deletions src/engine/server/databases/mysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ class CMysqlConnection : public IDbConnection
~CMysqlConnection();
void Print(IConsole *pConsole, const char *pMode) override;

CMysqlConnection *Copy() override;

const char *BinaryCollate() const override { return "utf8mb4_bin"; }
void ToUnixTimestamp(const char *pTimestamp, char *aBuf, unsigned int BufferSize) override;
const char *InsertTimestampAsUtc() const override { return "?"; }
Expand Down Expand Up @@ -197,11 +195,6 @@ void CMysqlConnection::Print(IConsole *pConsole, const char *pMode)
pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
}

CMysqlConnection *CMysqlConnection::Copy()
{
return new CMysqlConnection(m_Config);
}

void CMysqlConnection::ToUnixTimestamp(const char *pTimestamp, char *aBuf, unsigned int BufferSize)
{
str_format(aBuf, BufferSize, "UNIX_TIMESTAMP(%s)", pTimestamp);
Expand Down
7 changes: 0 additions & 7 deletions src/engine/server/databases/sqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class CSqliteConnection : public IDbConnection
virtual ~CSqliteConnection();
void Print(IConsole *pConsole, const char *pMode) override;

CSqliteConnection *Copy() override;

const char *BinaryCollate() const override { return "BINARY"; }
void ToUnixTimestamp(const char *pTimestamp, char *aBuf, unsigned int BufferSize) override;
const char *InsertTimestampAsUtc() const override { return "DATETIME(?, 'utc')"; }
Expand Down Expand Up @@ -108,11 +106,6 @@ void CSqliteConnection::ToUnixTimestamp(const char *pTimestamp, char *aBuf, unsi
str_format(aBuf, BufferSize, "strftime('%%s', %s)", pTimestamp);
}

CSqliteConnection *CSqliteConnection::Copy()
{
return new CSqliteConnection(m_aFilename, m_Setup);
}

bool CSqliteConnection::Connect(char *pError, int ErrorSize)
{
if(m_InUse.exchange(true))
Expand Down

0 comments on commit bb14732

Please sign in to comment.