[Repositories] Insert repository improvements (#1236)

* Insert repository improvements

* Remove no longer necessary code, remove license banner since we have a license at the repo level

* Update template comments
This commit is contained in:
Chris Miles
2021-02-08 20:56:44 -06:00
committed by GitHub
parent 694d380e66
commit 96b65b848b
161 changed files with 1473 additions and 6318 deletions
@@ -1,29 +1,12 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
* DO NOT MODIFY THIS FILE
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY except by those people which sell it, which
* are required to give you total support for your newly bought product;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
*/
/**
* 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
* 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
*
* @generator ./utils/scripts/generators/repository-generator.pl
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
*/
#ifndef EQEMU_BASE_BUGS_REPOSITORY_H
@@ -79,21 +62,6 @@ public:
return std::string(implode(", ", Columns()));
}
static std::string InsertColumnsRaw()
{
std::vector<std::string> insert_columns;
for (auto &column : Columns()) {
if (column == PrimaryKey()) {
continue;
}
insert_columns.push_back(column);
}
return std::string(implode(", ", insert_columns));
}
static std::string TableName()
{
return std::string("bugs");
@@ -113,7 +81,7 @@ public:
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
InsertColumnsRaw()
ColumnsRaw()
);
}
@@ -248,6 +216,7 @@ public:
{
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(bugs_entry.id));
insert_values.push_back("'" + EscapeString(bugs_entry.zone) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.name) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.ui) + "'");
@@ -289,6 +258,7 @@ public:
for (auto &bugs_entry: bugs_entries) {
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(bugs_entry.id));
insert_values.push_back("'" + EscapeString(bugs_entry.zone) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.name) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.ui) + "'");