[Bots] Convert Load, Save, SaveNew, and Delete to Repositories. (#2614)

* [Bots] Convert Load, Save, SaveNew, and Delete to Repositories.

# Notes
- General code cleanup, as manually adding to these queries doesn't scale very well.

* FindOne.

* Update base_bot_data_repository.h

* Update template.
This commit is contained in:
Alex King
2022-12-04 18:22:35 -05:00
committed by GitHub
parent 9a35cacf27
commit 423e6ae751
4 changed files with 168 additions and 338 deletions
@@ -300,7 +300,8 @@ public:
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
"{} WHERE {} = {} LIMIT 1",
PrimaryKey(),
BaseSelect(),
bot_data_id
)
@@ -104,7 +104,8 @@ public:
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
"{} WHERE {} = {} LIMIT 1",
PrimaryKey(),
BaseSelect(),
{{TABLE_NAME_VAR}}_id
)