mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-01 01:52:02 +00:00
Explicitly pass database pointers to repository methods
This commit is contained in:
@@ -126,10 +126,11 @@ public:
|
||||
}
|
||||
|
||||
static ExpeditionMembers FindOne(
|
||||
Database& db,
|
||||
int expedition_members_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +154,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int expedition_members_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +171,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
ExpeditionMembers expedition_members_entry
|
||||
)
|
||||
{
|
||||
@@ -180,7 +183,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(expedition_members_entry.character_id));
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(expedition_members_entry.is_current_member));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -194,6 +197,7 @@ public:
|
||||
}
|
||||
|
||||
static ExpeditionMembers InsertOne(
|
||||
Database& db,
|
||||
ExpeditionMembers expedition_members_entry
|
||||
)
|
||||
{
|
||||
@@ -222,6 +226,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<ExpeditionMembers> expedition_members_entries
|
||||
)
|
||||
{
|
||||
@@ -239,7 +244,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -250,11 +255,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<ExpeditionMembers> All()
|
||||
static std::vector<ExpeditionMembers> All(Database& db)
|
||||
{
|
||||
std::vector<ExpeditionMembers> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -277,11 +282,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<ExpeditionMembers> GetWhere(std::string where_filter)
|
||||
static std::vector<ExpeditionMembers> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<ExpeditionMembers> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -305,9 +310,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -318,9 +323,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
Reference in New Issue
Block a user