Repository tweaks [skip ci]

This commit is contained in:
Akkadius
2020-04-11 02:47:54 -05:00
parent 5c7eb0707f
commit e0363a8fe1
173 changed files with 1185 additions and 3011 deletions
@@ -20,8 +20,8 @@
*/
/**
* This repository was automatically generated on Apr 5, 2020 and is NOT
* to be modified directly. Any repository modifications are meant to be made to
* This repository was automatically generated and is NOT to be modified directly.
* Any repository modifications are meant to be made to
* the repository extending the base. Any modifications to base repositories are to
* be made by the generator only
*/
@@ -42,7 +42,7 @@ public:
static std::string PrimaryKey()
{
return std::string("type");
return std::string("id");
}
static std::vector<std::string> Columns()
@@ -114,7 +114,7 @@ public:
)
{
for (auto &db_str : db_strs) {
if (db_str.type == db_str_id) {
if (db_str.id == db_str_id) {
return db_str;
}
}
@@ -172,6 +172,8 @@ public:
auto columns = Columns();
update_values.push_back(columns[0] + " = " + std::to_string(db_str_entry.id));
update_values.push_back(columns[1] + " = " + std::to_string(db_str_entry.type));
update_values.push_back(columns[2] + " = '" + EscapeString(db_str_entry.value) + "'");
auto results = database.QueryDatabase(
@@ -180,7 +182,7 @@ public:
TableName(),
implode(", ", update_values),
PrimaryKey(),
db_str_entry.type
db_str_entry.id
)
);
@@ -193,6 +195,8 @@ public:
{
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(db_str_entry.id));
insert_values.push_back(std::to_string(db_str_entry.type));
insert_values.push_back("'" + EscapeString(db_str_entry.value) + "'");
auto results = database.QueryDatabase(
@@ -222,6 +226,8 @@ public:
for (auto &db_str_entry: db_str_entries) {
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(db_str_entry.id));
insert_values.push_back(std::to_string(db_str_entry.type));
insert_values.push_back("'" + EscapeString(db_str_entry.value) + "'");
insert_chunks.push_back("(" + implode(",", insert_values) + ")");