Beginning of multi-tenancy work

This commit is contained in:
Akkadius
2020-03-11 02:43:21 -05:00
parent 240d5c2a66
commit dde9b98e4f
7 changed files with 109 additions and 28 deletions
+25 -7
View File
@@ -35,13 +35,14 @@
DBcore::DBcore()
{
mysql_init(&mysql);
pHost = 0;
pUser = 0;
pPassword = 0;
pDatabase = 0;
pCompress = false;
pSSL = false;
pStatus = Closed;
pHost = nullptr;
pUser = nullptr;
pPassword = nullptr;
pDatabase = nullptr;
pCompress = false;
pSSL = false;
pStatus = Closed;
connection_type = DATABASE_CONNECTION_DEFAULT;
}
DBcore::~DBcore()
@@ -81,6 +82,8 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
Open();
}
// request query. != 0 indicates some kind of error.
if (mysql_real_query(&mysql, query, querylen) != 0) {
unsigned int errorNumber = mysql_errno(&mysql);
@@ -258,6 +261,21 @@ bool DBcore::Open(uint32 *errnum, char *errbuf)
}
}
void DBcore::SetMysql(MYSQL *mysql)
{
DBcore::mysql = *mysql;
}
int8 DBcore::GetConnectionType() const
{
return connection_type;
}
void DBcore::SetConnectionType(int8 connection_type)
{
DBcore::connection_type = connection_type;
}