mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-29 19:05:45 +00:00
Compare commits
131 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 74fde3972b | |||
| 5e45bf262d | |||
| e4dc304b5a | |||
| aff1223181 | |||
| 10ffcf155d | |||
| ed71543dff | |||
| 0dcaea1e4e | |||
| 52a359180c | |||
| 8f89f38f5c | |||
| f2b67ae969 | |||
| ef0398ebd3 | |||
| dcc921efcb | |||
| eedd5e2821 | |||
| 96b65b848b | |||
| 694d380e66 | |||
| 672c09ee11 | |||
| ca9756abc9 | |||
| da7b5b3560 | |||
| ecc1dd9475 | |||
| 8f7702095b | |||
| 13303a1e14 | |||
| b184a5d013 | |||
| 9f5ce8e3c9 | |||
| 6621338064 | |||
| 00902d8a7e | |||
| 01f69bcc51 | |||
| f429df39a9 | |||
| 0c533071d4 | |||
| fac9c3469f | |||
| 8414973077 | |||
| 5fba138a5a | |||
| 053bdb8646 | |||
| ff5ea82e38 | |||
| 55d4865d36 | |||
| b01793081a | |||
| 18e9c4dc95 | |||
| ed9f155f7c | |||
| d83dc339fc | |||
| 8d7fdd6549 | |||
| 65f2f823a8 | |||
| fac75a3ae0 | |||
| 19e9c0bc22 | |||
| 9816608bba | |||
| 83b279bac3 | |||
| 32aeb6197f | |||
| 11eab9c284 | |||
| 8d863a507b | |||
| c194e2ac9c | |||
| aeb0dbc6ae | |||
| 4039cb12ba | |||
| b7983d4c20 | |||
| e8ab176d4a | |||
| b7f7c66a50 | |||
| 3455863099 | |||
| 7fe0bbacd4 | |||
| c8dfb72cd2 | |||
| 42b34bbf87 | |||
| 963b8fdd53 | |||
| 0923ff040f | |||
| 369461f9e1 | |||
| bb2dcdcb31 | |||
| e67b3dd6d4 | |||
| ddfc0dda42 | |||
| f7cc51c134 | |||
| 1b27d9dc9d | |||
| 8011c4afcc | |||
| 69de53c459 | |||
| 82b3cccc95 | |||
| 91d9a4f73c | |||
| 93f83923ce | |||
| 9759208ed6 | |||
| 9d3d9a97ff | |||
| a29de5963f | |||
| 381b029ffc | |||
| 772c88d020 | |||
| b69213abcc | |||
| 4338d657fc | |||
| 2430b38406 | |||
| 6cfe7853f5 | |||
| 64c97a5283 | |||
| f32f4346e7 | |||
| dcc2dcdb8d | |||
| 9b8845949e | |||
| 36bfebfe6a | |||
| 0c70004102 | |||
| 5238d30236 | |||
| 58e0ce6a4b | |||
| e4b437cb5f | |||
| 5a94e82db8 | |||
| 9713d62849 | |||
| a751339c99 | |||
| 62e480fed7 | |||
| b74edd9dc2 | |||
| 7eba9552e2 | |||
| 396c300315 | |||
| c192590af6 | |||
| fb5fc935e7 | |||
| 780c7a8476 | |||
| c72e18f082 | |||
| a90d836bcd | |||
| c0129a6b8a | |||
| a77d2408ac | |||
| 6baf8412c6 | |||
| 9907984aca | |||
| f767a7c076 | |||
| 445fcc2d40 | |||
| f4ee11ac62 | |||
| d30593c35e | |||
| 102263f37d | |||
| 19ae461e36 | |||
| c481d52064 | |||
| 7c69400618 | |||
| ca98ea9872 | |||
| 7d40e42cc2 | |||
| f1920f2132 | |||
| 30490abc50 | |||
| c5c0a3a73e | |||
| 0551cfc013 | |||
| 1a2cec58f1 | |||
| a9b992a1b0 | |||
| d87ae839a2 | |||
| 0f859a2a0f | |||
| 7e1e1651e4 | |||
| 1c00edb458 | |||
| eb24e333d7 | |||
| 836210404c | |||
| 896dd48960 | |||
| 312ee2b42c | |||
| 3fc1aea3ce | |||
| ed351fb4cb | |||
| 7bea9a7273 |
+14
-1
@@ -55,6 +55,7 @@ FIND_PACKAGE(MariaDB)
|
||||
FIND_PACKAGE(ZLIB)
|
||||
FIND_PACKAGE(OpenSSL)
|
||||
FIND_PACKAGE(Lua51)
|
||||
FIND_PACKAGE(LuaJit)
|
||||
FIND_PACKAGE(PerlLibs)
|
||||
FIND_PACKAGE(Sodium)
|
||||
FIND_PACKAGE(mbedTLS)
|
||||
@@ -87,6 +88,12 @@ ELSE()
|
||||
MESSAGE(STATUS "* Lua: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
IF(LuaJit_FOUND)
|
||||
MESSAGE(STATUS "* LuaJIT: FOUND *")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "* LuaJIT: MISSING *")
|
||||
ENDIF()
|
||||
|
||||
IF(PerlLibs_FOUND)
|
||||
MESSAGE(STATUS "* Perl: FOUND *")
|
||||
ELSE()
|
||||
@@ -122,6 +129,7 @@ OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON)
|
||||
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
|
||||
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
|
||||
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
|
||||
OPTION(EQEMU_PREFER_LUA "Build with normal Lua even if LuaJIT is found." OFF)
|
||||
|
||||
IF(EQEMU_COMMANDS_LOGGING)
|
||||
ADD_DEFINITIONS(-DCOMMANDS_LOGGING)
|
||||
@@ -212,7 +220,12 @@ ELSE()
|
||||
SET(SODIUM_LIBRARY_ENABLED OFF)
|
||||
ENDIF()
|
||||
|
||||
IF(Lua51_FOUND)
|
||||
IF(LUAJIT_FOUND AND NOT (EQEMU_PREFER_LUA AND Lua51_FOUND))
|
||||
SET(LUA_LIBRARY_TYPE " LuaJIT")
|
||||
SET(LUA_LIBRARY_ENABLED ON)
|
||||
SET(LUA_LIBRARY_LIBS ${LUAJIT_LIBRARY} luabind)
|
||||
SET(LUA_LIBRARY_INCLUDE ${LUAJIT_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind")
|
||||
ELSEIF(Lua51_FOUND )
|
||||
SET(LUA_LIBRARY_TYPE " Lua 5.1")
|
||||
SET(LUA_LIBRARY_ENABLED ON)
|
||||
SET(LUA_LIBRARY_LIBS ${LUA_LIBRARY} luabind)
|
||||
|
||||
@@ -38,7 +38,7 @@ locations other than lua/
|
||||
find_path(LUA_INCLUDE_DIR lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include/luajit include
|
||||
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
@@ -49,7 +49,7 @@ find_path(LUA_INCLUDE_DIR lua.h
|
||||
)
|
||||
|
||||
find_library(LUA_LIBRARY
|
||||
NAMES lua51 lua5.1 lua-5.1 lua luajit
|
||||
NAMES lua51 lua5.1 lua-5.1 lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES lib
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
# Modified from the FindLua51 that comes with CMake
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindLuaJit
|
||||
---------
|
||||
|
||||
|
||||
|
||||
Locate LuaJit library This module defines
|
||||
|
||||
::
|
||||
|
||||
LUAJIT_FOUND, if false, do not try to link to Lua
|
||||
LUAJIT_LIBRARIES
|
||||
LUAJIT_INCLUDE_DIR, where to find lua.h
|
||||
LUAJIT_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
|
||||
|
||||
|
||||
|
||||
Note that the expected include convention is
|
||||
|
||||
::
|
||||
|
||||
#include "lua.h"
|
||||
|
||||
and not
|
||||
|
||||
::
|
||||
|
||||
#include <lua/lua.h>
|
||||
|
||||
This is because, the lua location is not standardized and may exist in
|
||||
locations other than lua/
|
||||
#]=======================================================================]
|
||||
|
||||
find_path(LUAJIT_INCLUDE_DIR lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES include/luajit include/luajit-2.0 include/luajit-2.1
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
|
||||
find_library(LUAJIT_LIBRARY
|
||||
NAMES luajit51 luajit5.1 luajit-5.1 luajit
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
|
||||
if(LUAJIT_LIBRARY)
|
||||
# include the math library for Unix
|
||||
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
|
||||
find_library(LUAJIT_MATH_LIBRARY m)
|
||||
set( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY};${LUAJIT_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
else()
|
||||
set( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LUAJIT_INCLUDE_DIR AND EXISTS "${LUAJIT_INCLUDE_DIR}/lua.h")
|
||||
file(STRINGS "${LUAJIT_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
||||
|
||||
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUAJIT_VERSION_STRING "${lua_version_str}")
|
||||
unset(lua_version_str)
|
||||
endif()
|
||||
|
||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJit
|
||||
REQUIRED_VARS LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR
|
||||
VERSION_VAR LUAJIT_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUAJIT_MATH_LIBRARY)
|
||||
|
||||
+12
-2
@@ -148,6 +148,7 @@ SET(repositories
|
||||
repositories/base/base_character_currency_repository.h
|
||||
repositories/base/base_character_data_repository.h
|
||||
repositories/base/base_character_disciplines_repository.h
|
||||
repositories/base/base_character_expedition_lockouts_repository.h
|
||||
repositories/base/base_character_inspect_messages_repository.h
|
||||
repositories/base/base_character_item_recast_repository.h
|
||||
repositories/base/base_character_languages_repository.h
|
||||
@@ -166,11 +167,16 @@ SET(repositories
|
||||
repositories/base/base_char_recipe_list_repository.h
|
||||
repositories/base/base_completed_tasks_repository.h
|
||||
repositories/base/base_content_flags_repository.h
|
||||
repositories/base/base_damageshieldtypes_repository.h
|
||||
repositories/base/base_data_buckets_repository.h
|
||||
repositories/base/base_db_str_repository.h
|
||||
repositories/base/base_discovered_items_repository.h
|
||||
repositories/base/base_doors_repository.h
|
||||
repositories/base/base_dynamic_zones_repository.h
|
||||
repositories/base/base_eventlog_repository.h
|
||||
repositories/base/base_expeditions_repository.h
|
||||
repositories/base/base_expedition_lockouts_repository.h
|
||||
repositories/base/base_expedition_members_repository.h
|
||||
repositories/base/base_faction_base_data_repository.h
|
||||
repositories/base/base_faction_list_repository.h
|
||||
repositories/base/base_faction_list_mod_repository.h
|
||||
@@ -267,7 +273,6 @@ SET(repositories
|
||||
repositories/base/base_traps_repository.h
|
||||
repositories/base/base_tributes_repository.h
|
||||
repositories/base/base_tribute_levels_repository.h
|
||||
repositories/base/base_variables_repository.h
|
||||
repositories/base/base_veteran_reward_templates_repository.h
|
||||
repositories/base/base_zone_repository.h
|
||||
repositories/base/base_zone_points_repository.h
|
||||
@@ -306,6 +311,7 @@ SET(repositories
|
||||
repositories/character_currency_repository.h
|
||||
repositories/character_data_repository.h
|
||||
repositories/character_disciplines_repository.h
|
||||
repositories/character_expedition_lockouts_repository.h
|
||||
repositories/character_inspect_messages_repository.h
|
||||
repositories/character_item_recast_repository.h
|
||||
repositories/character_languages_repository.h
|
||||
@@ -324,11 +330,16 @@ SET(repositories
|
||||
repositories/char_recipe_list_repository.h
|
||||
repositories/completed_tasks_repository.h
|
||||
repositories/content_flags_repository.h
|
||||
repositories/damageshieldtypes_repository.h
|
||||
repositories/data_buckets_repository.h
|
||||
repositories/db_str_repository.h
|
||||
repositories/discovered_items_repository.h
|
||||
repositories/doors_repository.h
|
||||
repositories/dynamic_zones_repository.h
|
||||
repositories/eventlog_repository.h
|
||||
repositories/expeditions_repository.h
|
||||
repositories/expedition_lockouts_repository.h
|
||||
repositories/expedition_members_repository.h
|
||||
repositories/faction_base_data_repository.h
|
||||
repositories/faction_list_repository.h
|
||||
repositories/faction_list_mod_repository.h
|
||||
@@ -425,7 +436,6 @@ SET(repositories
|
||||
repositories/traps_repository.h
|
||||
repositories/tributes_repository.h
|
||||
repositories/tribute_levels_repository.h
|
||||
repositories/variables_repository.h
|
||||
repositories/veteran_reward_templates_repository.h
|
||||
repositories/zone_repository.h
|
||||
repositories/zone_points_repository.h
|
||||
|
||||
@@ -300,8 +300,7 @@ void DatabaseDumpService::Dump()
|
||||
config->DatabaseUsername
|
||||
);
|
||||
|
||||
std::string options = "--allow-keywords --extended-insert";
|
||||
|
||||
std::string options = "--allow-keywords --extended-insert --max-allowed-packet=1G --net-buffer-length=32704";
|
||||
if (IsDumpWithNoData()) {
|
||||
options += " --no-data";
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ namespace Logs {
|
||||
Expeditions,
|
||||
DynamicZones,
|
||||
Group,
|
||||
Adventure,
|
||||
MaxCategoryID /* Don't Remove this */
|
||||
};
|
||||
|
||||
@@ -201,6 +202,7 @@ namespace Logs {
|
||||
"Expeditions",
|
||||
"DynamicZones",
|
||||
"Group",
|
||||
"Adventure",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -636,6 +636,16 @@
|
||||
OutF(LogSys, Logs::Detail, Logs::DynamicZones, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAdventure(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::Adventure].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::General, Logs::Adventure, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogAdventureDetail(message, ...) do {\
|
||||
if (LogSys.log_settings[Logs::Adventure].is_category_enabled == 1)\
|
||||
OutF(LogSys, Logs::Detail, Logs::Adventure, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define Log(debug_level, log_category, message, ...) do {\
|
||||
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
|
||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
|
||||
@@ -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_AA_ABILITY_REPOSITORY_H
|
||||
@@ -81,21 +64,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("aa_ability");
|
||||
@@ -115,7 +83,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -156,10 +124,11 @@ public:
|
||||
}
|
||||
|
||||
static AaAbility FindOne(
|
||||
Database& db,
|
||||
int aa_ability_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -193,10 +162,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int aa_ability_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -209,6 +179,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AaAbility aa_ability_entry
|
||||
)
|
||||
{
|
||||
@@ -231,7 +202,7 @@ public:
|
||||
update_values.push_back(columns[12] + " = " + std::to_string(aa_ability_entry.enabled));
|
||||
update_values.push_back(columns[13] + " = " + std::to_string(aa_ability_entry.reset_on_death));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -245,6 +216,7 @@ public:
|
||||
}
|
||||
|
||||
static AaAbility InsertOne(
|
||||
Database& db,
|
||||
AaAbility aa_ability_entry
|
||||
)
|
||||
{
|
||||
@@ -265,7 +237,7 @@ public:
|
||||
insert_values.push_back(std::to_string(aa_ability_entry.enabled));
|
||||
insert_values.push_back(std::to_string(aa_ability_entry.reset_on_death));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -284,6 +256,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AaAbility> aa_ability_entries
|
||||
)
|
||||
{
|
||||
@@ -312,7 +285,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -323,11 +296,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AaAbility> All()
|
||||
static std::vector<AaAbility> All(Database& db)
|
||||
{
|
||||
std::vector<AaAbility> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -360,11 +333,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AaAbility> GetWhere(std::string where_filter)
|
||||
static std::vector<AaAbility> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AaAbility> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -398,9 +371,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -411,9 +384,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_AA_RANK_EFFECTS_REPOSITORY_H
|
||||
@@ -63,21 +46,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("aa_rank_effects");
|
||||
@@ -97,7 +65,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,10 +97,11 @@ public:
|
||||
}
|
||||
|
||||
static AaRankEffects FindOne(
|
||||
Database& db,
|
||||
int aa_rank_effects_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -157,10 +126,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int aa_rank_effects_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -173,6 +143,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AaRankEffects aa_rank_effects_entry
|
||||
)
|
||||
{
|
||||
@@ -186,7 +157,7 @@ public:
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(aa_rank_effects_entry.base1));
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(aa_rank_effects_entry.base2));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -200,6 +171,7 @@ public:
|
||||
}
|
||||
|
||||
static AaRankEffects InsertOne(
|
||||
Database& db,
|
||||
AaRankEffects aa_rank_effects_entry
|
||||
)
|
||||
{
|
||||
@@ -211,7 +183,7 @@ public:
|
||||
insert_values.push_back(std::to_string(aa_rank_effects_entry.base1));
|
||||
insert_values.push_back(std::to_string(aa_rank_effects_entry.base2));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -230,6 +202,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AaRankEffects> aa_rank_effects_entries
|
||||
)
|
||||
{
|
||||
@@ -249,7 +222,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -260,11 +233,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AaRankEffects> All()
|
||||
static std::vector<AaRankEffects> All(Database& db)
|
||||
{
|
||||
std::vector<AaRankEffects> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -288,11 +261,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AaRankEffects> GetWhere(std::string where_filter)
|
||||
static std::vector<AaRankEffects> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AaRankEffects> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -317,9 +290,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -330,9 +303,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_AA_RANK_PREREQS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("aa_rank_prereqs");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static AaRankPrereqs FindOne(
|
||||
Database& db,
|
||||
int aa_rank_prereqs_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int aa_rank_prereqs_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AaRankPrereqs aa_rank_prereqs_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(aa_rank_prereqs_entry.aa_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(aa_rank_prereqs_entry.points));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static AaRankPrereqs InsertOne(
|
||||
Database& db,
|
||||
AaRankPrereqs aa_rank_prereqs_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(aa_rank_prereqs_entry.aa_id));
|
||||
insert_values.push_back(std::to_string(aa_rank_prereqs_entry.points));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AaRankPrereqs> aa_rank_prereqs_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AaRankPrereqs> All()
|
||||
static std::vector<AaRankPrereqs> All(Database& db)
|
||||
{
|
||||
std::vector<AaRankPrereqs> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AaRankPrereqs> GetWhere(std::string where_filter)
|
||||
static std::vector<AaRankPrereqs> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AaRankPrereqs> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -312,9 +285,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_AA_RANKS_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("aa_ranks");
|
||||
@@ -113,7 +81,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -153,10 +121,11 @@ public:
|
||||
}
|
||||
|
||||
static AaRanks FindOne(
|
||||
Database& db,
|
||||
int aa_ranks_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -189,10 +158,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int aa_ranks_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -205,6 +175,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AaRanks aa_ranks_entry
|
||||
)
|
||||
{
|
||||
@@ -226,7 +197,7 @@ public:
|
||||
update_values.push_back(columns[11] + " = " + std::to_string(aa_ranks_entry.prev_id));
|
||||
update_values.push_back(columns[12] + " = " + std::to_string(aa_ranks_entry.next_id));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -240,6 +211,7 @@ public:
|
||||
}
|
||||
|
||||
static AaRanks InsertOne(
|
||||
Database& db,
|
||||
AaRanks aa_ranks_entry
|
||||
)
|
||||
{
|
||||
@@ -259,7 +231,7 @@ public:
|
||||
insert_values.push_back(std::to_string(aa_ranks_entry.prev_id));
|
||||
insert_values.push_back(std::to_string(aa_ranks_entry.next_id));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -278,6 +250,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AaRanks> aa_ranks_entries
|
||||
)
|
||||
{
|
||||
@@ -305,7 +278,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -316,11 +289,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AaRanks> All()
|
||||
static std::vector<AaRanks> All(Database& db)
|
||||
{
|
||||
std::vector<AaRanks> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -352,11 +325,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AaRanks> GetWhere(std::string where_filter)
|
||||
static std::vector<AaRanks> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AaRanks> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -389,9 +362,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -402,9 +375,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_ACCOUNT_FLAGS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("account_flags");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static AccountFlags FindOne(
|
||||
Database& db,
|
||||
int account_flags_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int account_flags_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AccountFlags account_flags_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = '" + EscapeString(account_flags_entry.p_flag) + "'");
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(account_flags_entry.p_value) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static AccountFlags InsertOne(
|
||||
Database& db,
|
||||
AccountFlags account_flags_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(account_flags_entry.p_flag) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_flags_entry.p_value) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AccountFlags> account_flags_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AccountFlags> All()
|
||||
static std::vector<AccountFlags> All(Database& db)
|
||||
{
|
||||
std::vector<AccountFlags> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AccountFlags> GetWhere(std::string where_filter)
|
||||
static std::vector<AccountFlags> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AccountFlags> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_ACCOUNT_IP_REPOSITORY_H
|
||||
@@ -61,21 +44,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("account_ip");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static AccountIp FindOne(
|
||||
Database& db,
|
||||
int account_ip_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int account_ip_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AccountIp account_ip_entry
|
||||
)
|
||||
{
|
||||
@@ -181,7 +152,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(account_ip_entry.count));
|
||||
update_values.push_back(columns[3] + " = '" + EscapeString(account_ip_entry.lastused) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -195,6 +166,7 @@ public:
|
||||
}
|
||||
|
||||
static AccountIp InsertOne(
|
||||
Database& db,
|
||||
AccountIp account_ip_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +177,7 @@ public:
|
||||
insert_values.push_back(std::to_string(account_ip_entry.count));
|
||||
insert_values.push_back("'" + EscapeString(account_ip_entry.lastused) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -224,6 +196,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AccountIp> account_ip_entries
|
||||
)
|
||||
{
|
||||
@@ -242,7 +215,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -253,11 +226,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AccountIp> All()
|
||||
static std::vector<AccountIp> All(Database& db)
|
||||
{
|
||||
std::vector<AccountIp> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -280,11 +253,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AccountIp> GetWhere(std::string where_filter)
|
||||
static std::vector<AccountIp> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AccountIp> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -308,9 +281,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(),
|
||||
@@ -321,9 +294,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()
|
||||
|
||||
@@ -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_ACCOUNT_REPOSITORY_H
|
||||
@@ -91,21 +74,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("account");
|
||||
@@ -125,7 +93,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -171,10 +139,11 @@ public:
|
||||
}
|
||||
|
||||
static Account FindOne(
|
||||
Database& db,
|
||||
int account_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -213,10 +182,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int account_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -229,6 +199,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Account account_entry
|
||||
)
|
||||
{
|
||||
@@ -255,7 +226,7 @@ public:
|
||||
update_values.push_back(columns[17] + " = '" + EscapeString(account_entry.ban_reason) + "'");
|
||||
update_values.push_back(columns[18] + " = '" + EscapeString(account_entry.suspend_reason) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -269,11 +240,13 @@ public:
|
||||
}
|
||||
|
||||
static Account InsertOne(
|
||||
Database& db,
|
||||
Account account_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(account_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(account_entry.name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.charname) + "'");
|
||||
insert_values.push_back(std::to_string(account_entry.sharedplat));
|
||||
@@ -293,7 +266,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -312,6 +285,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Account> account_entries
|
||||
)
|
||||
{
|
||||
@@ -320,6 +294,7 @@ public:
|
||||
for (auto &account_entry: account_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(account_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(account_entry.name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(account_entry.charname) + "'");
|
||||
insert_values.push_back(std::to_string(account_entry.sharedplat));
|
||||
@@ -344,7 +319,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -355,11 +330,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Account> All()
|
||||
static std::vector<Account> All(Database& db)
|
||||
{
|
||||
std::vector<Account> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -397,11 +372,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Account> GetWhere(std::string where_filter)
|
||||
static std::vector<Account> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Account> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -440,9 +415,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(),
|
||||
@@ -453,9 +428,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()
|
||||
|
||||
@@ -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_ACCOUNT_REWARDS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("account_rewards");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static AccountRewards FindOne(
|
||||
Database& db,
|
||||
int account_rewards_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int account_rewards_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AccountRewards account_rewards_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(account_rewards_entry.reward_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(account_rewards_entry.amount));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static AccountRewards InsertOne(
|
||||
Database& db,
|
||||
AccountRewards account_rewards_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(account_rewards_entry.reward_id));
|
||||
insert_values.push_back(std::to_string(account_rewards_entry.amount));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AccountRewards> account_rewards_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AccountRewards> All()
|
||||
static std::vector<AccountRewards> All(Database& db)
|
||||
{
|
||||
std::vector<AccountRewards> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AccountRewards> GetWhere(std::string where_filter)
|
||||
static std::vector<AccountRewards> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AccountRewards> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_ADVENTURE_DETAILS_REPOSITORY_H
|
||||
@@ -71,21 +54,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("adventure_details");
|
||||
@@ -105,7 +73,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,10 +109,11 @@ public:
|
||||
}
|
||||
|
||||
static AdventureDetails FindOne(
|
||||
Database& db,
|
||||
int adventure_details_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -173,10 +142,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int adventure_details_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,6 +159,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AdventureDetails adventure_details_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +176,7 @@ public:
|
||||
update_values.push_back(columns[7] + " = " + std::to_string(adventure_details_entry.time_zoned));
|
||||
update_values.push_back(columns[8] + " = " + std::to_string(adventure_details_entry.time_completed));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -219,11 +190,13 @@ public:
|
||||
}
|
||||
|
||||
static AdventureDetails InsertOne(
|
||||
Database& db,
|
||||
AdventureDetails adventure_details_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.id));
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.adventure_id));
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.instance_id));
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.count));
|
||||
@@ -233,7 +206,7 @@ public:
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.time_zoned));
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.time_completed));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -252,6 +225,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AdventureDetails> adventure_details_entries
|
||||
)
|
||||
{
|
||||
@@ -260,6 +234,7 @@ public:
|
||||
for (auto &adventure_details_entry: adventure_details_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.id));
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.adventure_id));
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.instance_id));
|
||||
insert_values.push_back(std::to_string(adventure_details_entry.count));
|
||||
@@ -274,7 +249,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -285,11 +260,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AdventureDetails> All()
|
||||
static std::vector<AdventureDetails> All(Database& db)
|
||||
{
|
||||
std::vector<AdventureDetails> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -317,11 +292,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AdventureDetails> GetWhere(std::string where_filter)
|
||||
static std::vector<AdventureDetails> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AdventureDetails> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -350,9 +325,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(),
|
||||
@@ -363,9 +338,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()
|
||||
|
||||
@@ -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_ADVENTURE_MEMBERS_REPOSITORY_H
|
||||
@@ -57,21 +40,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("adventure_members");
|
||||
@@ -91,7 +59,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -120,10 +88,11 @@ public:
|
||||
}
|
||||
|
||||
static AdventureMembers FindOne(
|
||||
Database& db,
|
||||
int adventure_members_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -145,10 +114,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int adventure_members_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -161,6 +131,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AdventureMembers adventure_members_entry
|
||||
)
|
||||
{
|
||||
@@ -171,7 +142,7 @@ public:
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(adventure_members_entry.id));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(adventure_members_entry.charid));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +156,7 @@ public:
|
||||
}
|
||||
|
||||
static AdventureMembers InsertOne(
|
||||
Database& db,
|
||||
AdventureMembers adventure_members_entry
|
||||
)
|
||||
{
|
||||
@@ -193,7 +165,7 @@ public:
|
||||
insert_values.push_back(std::to_string(adventure_members_entry.id));
|
||||
insert_values.push_back(std::to_string(adventure_members_entry.charid));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -212,6 +184,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AdventureMembers> adventure_members_entries
|
||||
)
|
||||
{
|
||||
@@ -228,7 +201,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -239,11 +212,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AdventureMembers> All()
|
||||
static std::vector<AdventureMembers> All(Database& db)
|
||||
{
|
||||
std::vector<AdventureMembers> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -264,11 +237,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AdventureMembers> GetWhere(std::string where_filter)
|
||||
static std::vector<AdventureMembers> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AdventureMembers> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -290,9 +263,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(),
|
||||
@@ -303,9 +276,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()
|
||||
|
||||
@@ -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_ADVENTURE_STATS_REPOSITORY_H
|
||||
@@ -75,21 +58,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("adventure_stats");
|
||||
@@ -109,7 +77,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -147,10 +115,11 @@ public:
|
||||
}
|
||||
|
||||
static AdventureStats FindOne(
|
||||
Database& db,
|
||||
int adventure_stats_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -181,10 +150,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int adventure_stats_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -197,6 +167,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AdventureStats adventure_stats_entry
|
||||
)
|
||||
{
|
||||
@@ -216,7 +187,7 @@ public:
|
||||
update_values.push_back(columns[9] + " = " + std::to_string(adventure_stats_entry.ruj_losses));
|
||||
update_values.push_back(columns[10] + " = " + std::to_string(adventure_stats_entry.tak_losses));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -230,6 +201,7 @@ public:
|
||||
}
|
||||
|
||||
static AdventureStats InsertOne(
|
||||
Database& db,
|
||||
AdventureStats adventure_stats_entry
|
||||
)
|
||||
{
|
||||
@@ -247,7 +219,7 @@ public:
|
||||
insert_values.push_back(std::to_string(adventure_stats_entry.ruj_losses));
|
||||
insert_values.push_back(std::to_string(adventure_stats_entry.tak_losses));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -266,6 +238,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AdventureStats> adventure_stats_entries
|
||||
)
|
||||
{
|
||||
@@ -291,7 +264,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -302,11 +275,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AdventureStats> All()
|
||||
static std::vector<AdventureStats> All(Database& db)
|
||||
{
|
||||
std::vector<AdventureStats> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -336,11 +309,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AdventureStats> GetWhere(std::string where_filter)
|
||||
static std::vector<AdventureStats> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AdventureStats> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -371,9 +344,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(),
|
||||
@@ -384,9 +357,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()
|
||||
|
||||
@@ -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_ADVENTURE_TEMPLATE_ENTRY_FLAVOR_REPOSITORY_H
|
||||
@@ -57,21 +40,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("adventure_template_entry_flavor");
|
||||
@@ -91,7 +59,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -120,10 +88,11 @@ public:
|
||||
}
|
||||
|
||||
static AdventureTemplateEntryFlavor FindOne(
|
||||
Database& db,
|
||||
int adventure_template_entry_flavor_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -145,10 +114,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int adventure_template_entry_flavor_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -161,6 +131,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AdventureTemplateEntryFlavor adventure_template_entry_flavor_entry
|
||||
)
|
||||
{
|
||||
@@ -171,7 +142,7 @@ public:
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(adventure_template_entry_flavor_entry.id));
|
||||
update_values.push_back(columns[1] + " = '" + EscapeString(adventure_template_entry_flavor_entry.text) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +156,7 @@ public:
|
||||
}
|
||||
|
||||
static AdventureTemplateEntryFlavor InsertOne(
|
||||
Database& db,
|
||||
AdventureTemplateEntryFlavor adventure_template_entry_flavor_entry
|
||||
)
|
||||
{
|
||||
@@ -193,7 +165,7 @@ public:
|
||||
insert_values.push_back(std::to_string(adventure_template_entry_flavor_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(adventure_template_entry_flavor_entry.text) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -212,6 +184,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AdventureTemplateEntryFlavor> adventure_template_entry_flavor_entries
|
||||
)
|
||||
{
|
||||
@@ -228,7 +201,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -239,11 +212,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AdventureTemplateEntryFlavor> All()
|
||||
static std::vector<AdventureTemplateEntryFlavor> All(Database& db)
|
||||
{
|
||||
std::vector<AdventureTemplateEntryFlavor> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -264,11 +237,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AdventureTemplateEntryFlavor> GetWhere(std::string where_filter)
|
||||
static std::vector<AdventureTemplateEntryFlavor> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AdventureTemplateEntryFlavor> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -290,9 +263,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -303,9 +276,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_ADVENTURE_TEMPLATE_ENTRY_REPOSITORY_H
|
||||
@@ -57,21 +40,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("adventure_template_entry");
|
||||
@@ -91,7 +59,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -120,10 +88,11 @@ public:
|
||||
}
|
||||
|
||||
static AdventureTemplateEntry FindOne(
|
||||
Database& db,
|
||||
int adventure_template_entry_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -145,10 +114,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int adventure_template_entry_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -161,6 +131,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AdventureTemplateEntry adventure_template_entry_entry
|
||||
)
|
||||
{
|
||||
@@ -171,7 +142,7 @@ public:
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(adventure_template_entry_entry.id));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(adventure_template_entry_entry.template_id));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +156,7 @@ public:
|
||||
}
|
||||
|
||||
static AdventureTemplateEntry InsertOne(
|
||||
Database& db,
|
||||
AdventureTemplateEntry adventure_template_entry_entry
|
||||
)
|
||||
{
|
||||
@@ -193,7 +165,7 @@ public:
|
||||
insert_values.push_back(std::to_string(adventure_template_entry_entry.id));
|
||||
insert_values.push_back(std::to_string(adventure_template_entry_entry.template_id));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -212,6 +184,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AdventureTemplateEntry> adventure_template_entry_entries
|
||||
)
|
||||
{
|
||||
@@ -228,7 +201,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -239,11 +212,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AdventureTemplateEntry> All()
|
||||
static std::vector<AdventureTemplateEntry> All(Database& db)
|
||||
{
|
||||
std::vector<AdventureTemplateEntry> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -264,11 +237,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AdventureTemplateEntry> GetWhere(std::string where_filter)
|
||||
static std::vector<AdventureTemplateEntry> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AdventureTemplateEntry> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -290,9 +263,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -303,9 +276,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_ADVENTURE_TEMPLATE_REPOSITORY_H
|
||||
@@ -119,21 +102,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("adventure_template");
|
||||
@@ -153,7 +121,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -213,10 +181,11 @@ public:
|
||||
}
|
||||
|
||||
static AdventureTemplate FindOne(
|
||||
Database& db,
|
||||
int adventure_template_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -269,10 +238,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int adventure_template_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -285,6 +255,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AdventureTemplate adventure_template_entry
|
||||
)
|
||||
{
|
||||
@@ -326,7 +297,7 @@ public:
|
||||
update_values.push_back(columns[31] + " = " + std::to_string(adventure_template_entry.graveyard_z));
|
||||
update_values.push_back(columns[32] + " = " + std::to_string(adventure_template_entry.graveyard_radius));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -340,6 +311,7 @@ public:
|
||||
}
|
||||
|
||||
static AdventureTemplate InsertOne(
|
||||
Database& db,
|
||||
AdventureTemplate adventure_template_entry
|
||||
)
|
||||
{
|
||||
@@ -379,7 +351,7 @@ public:
|
||||
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_z));
|
||||
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_radius));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -398,6 +370,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AdventureTemplate> adventure_template_entries
|
||||
)
|
||||
{
|
||||
@@ -445,7 +418,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -456,11 +429,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AdventureTemplate> All()
|
||||
static std::vector<AdventureTemplate> All(Database& db)
|
||||
{
|
||||
std::vector<AdventureTemplate> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -512,11 +485,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AdventureTemplate> GetWhere(std::string where_filter)
|
||||
static std::vector<AdventureTemplate> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AdventureTemplate> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -569,9 +542,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -582,9 +555,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_ALTERNATE_CURRENCY_REPOSITORY_H
|
||||
@@ -57,21 +40,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("alternate_currency");
|
||||
@@ -91,7 +59,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -120,10 +88,11 @@ public:
|
||||
}
|
||||
|
||||
static AlternateCurrency FindOne(
|
||||
Database& db,
|
||||
int alternate_currency_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -145,10 +114,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int alternate_currency_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -161,6 +131,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
AlternateCurrency alternate_currency_entry
|
||||
)
|
||||
{
|
||||
@@ -171,7 +142,7 @@ public:
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(alternate_currency_entry.id));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(alternate_currency_entry.item_id));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +156,7 @@ public:
|
||||
}
|
||||
|
||||
static AlternateCurrency InsertOne(
|
||||
Database& db,
|
||||
AlternateCurrency alternate_currency_entry
|
||||
)
|
||||
{
|
||||
@@ -193,7 +165,7 @@ public:
|
||||
insert_values.push_back(std::to_string(alternate_currency_entry.id));
|
||||
insert_values.push_back(std::to_string(alternate_currency_entry.item_id));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -212,6 +184,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<AlternateCurrency> alternate_currency_entries
|
||||
)
|
||||
{
|
||||
@@ -228,7 +201,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -239,11 +212,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<AlternateCurrency> All()
|
||||
static std::vector<AlternateCurrency> All(Database& db)
|
||||
{
|
||||
std::vector<AlternateCurrency> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -264,11 +237,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<AlternateCurrency> GetWhere(std::string where_filter)
|
||||
static std::vector<AlternateCurrency> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<AlternateCurrency> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -290,9 +263,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -303,9 +276,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_AURAS_REPOSITORY_H
|
||||
@@ -75,21 +58,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("auras");
|
||||
@@ -109,7 +77,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -147,10 +115,11 @@ public:
|
||||
}
|
||||
|
||||
static Auras FindOne(
|
||||
Database& db,
|
||||
int auras_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -181,10 +150,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int auras_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -197,6 +167,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Auras auras_entry
|
||||
)
|
||||
{
|
||||
@@ -216,7 +187,7 @@ public:
|
||||
update_values.push_back(columns[9] + " = " + std::to_string(auras_entry.icon));
|
||||
update_values.push_back(columns[10] + " = " + std::to_string(auras_entry.cast_time));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -230,6 +201,7 @@ public:
|
||||
}
|
||||
|
||||
static Auras InsertOne(
|
||||
Database& db,
|
||||
Auras auras_entry
|
||||
)
|
||||
{
|
||||
@@ -247,7 +219,7 @@ public:
|
||||
insert_values.push_back(std::to_string(auras_entry.icon));
|
||||
insert_values.push_back(std::to_string(auras_entry.cast_time));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -266,6 +238,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Auras> auras_entries
|
||||
)
|
||||
{
|
||||
@@ -291,7 +264,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -302,11 +275,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Auras> All()
|
||||
static std::vector<Auras> All(Database& db)
|
||||
{
|
||||
std::vector<Auras> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -336,11 +309,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Auras> GetWhere(std::string where_filter)
|
||||
static std::vector<Auras> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Auras> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -371,9 +344,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -384,9 +357,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_BASE_DATA_REPOSITORY_H
|
||||
@@ -73,21 +56,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("base_data");
|
||||
@@ -107,7 +75,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -144,10 +112,11 @@ public:
|
||||
}
|
||||
|
||||
static BaseData FindOne(
|
||||
Database& db,
|
||||
int base_data_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -177,10 +146,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int base_data_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -193,6 +163,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
BaseData base_data_entry
|
||||
)
|
||||
{
|
||||
@@ -211,7 +182,7 @@ public:
|
||||
update_values.push_back(columns[8] + " = " + std::to_string(base_data_entry.mana_fac));
|
||||
update_values.push_back(columns[9] + " = " + std::to_string(base_data_entry.end_fac));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -225,6 +196,7 @@ public:
|
||||
}
|
||||
|
||||
static BaseData InsertOne(
|
||||
Database& db,
|
||||
BaseData base_data_entry
|
||||
)
|
||||
{
|
||||
@@ -241,7 +213,7 @@ public:
|
||||
insert_values.push_back(std::to_string(base_data_entry.mana_fac));
|
||||
insert_values.push_back(std::to_string(base_data_entry.end_fac));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -260,6 +232,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<BaseData> base_data_entries
|
||||
)
|
||||
{
|
||||
@@ -284,7 +257,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -295,11 +268,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<BaseData> All()
|
||||
static std::vector<BaseData> All(Database& db)
|
||||
{
|
||||
std::vector<BaseData> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -328,11 +301,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<BaseData> GetWhere(std::string where_filter)
|
||||
static std::vector<BaseData> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<BaseData> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -362,9 +335,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -375,9 +348,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_BLOCKED_SPELLS_REPOSITORY_H
|
||||
@@ -77,21 +60,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("blocked_spells");
|
||||
@@ -111,7 +79,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -150,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static BlockedSpells FindOne(
|
||||
Database& db,
|
||||
int blocked_spells_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -185,10 +154,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int blocked_spells_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -201,6 +171,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
BlockedSpells blocked_spells_entry
|
||||
)
|
||||
{
|
||||
@@ -220,7 +191,7 @@ public:
|
||||
update_values.push_back(columns[10] + " = '" + EscapeString(blocked_spells_entry.message) + "'");
|
||||
update_values.push_back(columns[11] + " = '" + EscapeString(blocked_spells_entry.description) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -234,11 +205,13 @@ public:
|
||||
}
|
||||
|
||||
static BlockedSpells InsertOne(
|
||||
Database& db,
|
||||
BlockedSpells blocked_spells_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(blocked_spells_entry.id));
|
||||
insert_values.push_back(std::to_string(blocked_spells_entry.spellid));
|
||||
insert_values.push_back(std::to_string(blocked_spells_entry.type));
|
||||
insert_values.push_back(std::to_string(blocked_spells_entry.zoneid));
|
||||
@@ -251,7 +224,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(blocked_spells_entry.message) + "'");
|
||||
insert_values.push_back("'" + EscapeString(blocked_spells_entry.description) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -270,6 +243,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<BlockedSpells> blocked_spells_entries
|
||||
)
|
||||
{
|
||||
@@ -278,6 +252,7 @@ public:
|
||||
for (auto &blocked_spells_entry: blocked_spells_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(blocked_spells_entry.id));
|
||||
insert_values.push_back(std::to_string(blocked_spells_entry.spellid));
|
||||
insert_values.push_back(std::to_string(blocked_spells_entry.type));
|
||||
insert_values.push_back(std::to_string(blocked_spells_entry.zoneid));
|
||||
@@ -295,7 +270,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -306,11 +281,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<BlockedSpells> All()
|
||||
static std::vector<BlockedSpells> All(Database& db)
|
||||
{
|
||||
std::vector<BlockedSpells> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -341,11 +316,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<BlockedSpells> GetWhere(std::string where_filter)
|
||||
static std::vector<BlockedSpells> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<BlockedSpells> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -377,9 +352,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -390,9 +365,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_BUG_REPORTS_REPOSITORY_H
|
||||
@@ -117,21 +100,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("bug_reports");
|
||||
@@ -151,7 +119,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -210,10 +178,11 @@ public:
|
||||
}
|
||||
|
||||
static BugReports FindOne(
|
||||
Database& db,
|
||||
int bug_reports_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -265,10 +234,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int bug_reports_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -281,6 +251,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
BugReports bug_reports_entry
|
||||
)
|
||||
{
|
||||
@@ -320,7 +291,7 @@ public:
|
||||
update_values.push_back(columns[30] + " = '" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
||||
update_values.push_back(columns[31] + " = '" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -334,11 +305,13 @@ public:
|
||||
}
|
||||
|
||||
static BugReports InsertOne(
|
||||
Database& db,
|
||||
BugReports bug_reports_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(bug_reports_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.zone) + "'");
|
||||
insert_values.push_back(std::to_string(bug_reports_entry.client_version_id));
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.client_version_name) + "'");
|
||||
@@ -371,7 +344,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -390,6 +363,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<BugReports> bug_reports_entries
|
||||
)
|
||||
{
|
||||
@@ -398,6 +372,7 @@ public:
|
||||
for (auto &bug_reports_entry: bug_reports_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(bug_reports_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.zone) + "'");
|
||||
insert_values.push_back(std::to_string(bug_reports_entry.client_version_id));
|
||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.client_version_name) + "'");
|
||||
@@ -435,7 +410,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -446,11 +421,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<BugReports> All()
|
||||
static std::vector<BugReports> All(Database& db)
|
||||
{
|
||||
std::vector<BugReports> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -501,11 +476,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<BugReports> GetWhere(std::string where_filter)
|
||||
static std::vector<BugReports> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<BugReports> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -557,9 +532,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(),
|
||||
@@ -570,9 +545,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()
|
||||
|
||||
@@ -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()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -153,10 +121,11 @@ public:
|
||||
}
|
||||
|
||||
static Bugs FindOne(
|
||||
Database& db,
|
||||
int bugs_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -189,10 +158,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int bugs_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -205,6 +175,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Bugs bugs_entry
|
||||
)
|
||||
{
|
||||
@@ -225,7 +196,7 @@ public:
|
||||
update_values.push_back(columns[11] + " = '" + EscapeString(bugs_entry.date) + "'");
|
||||
update_values.push_back(columns[12] + " = " + std::to_string(bugs_entry.status));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -239,11 +210,13 @@ public:
|
||||
}
|
||||
|
||||
static Bugs InsertOne(
|
||||
Database& db,
|
||||
Bugs bugs_entry
|
||||
)
|
||||
{
|
||||
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) + "'");
|
||||
@@ -257,7 +230,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(bugs_entry.date) + "'");
|
||||
insert_values.push_back(std::to_string(bugs_entry.status));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -276,6 +249,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Bugs> bugs_entries
|
||||
)
|
||||
{
|
||||
@@ -284,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) + "'");
|
||||
@@ -302,7 +277,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -313,11 +288,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Bugs> All()
|
||||
static std::vector<Bugs> All(Database& db)
|
||||
{
|
||||
std::vector<Bugs> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -349,11 +324,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Bugs> GetWhere(std::string where_filter)
|
||||
static std::vector<Bugs> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Bugs> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -386,9 +361,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(),
|
||||
@@ -399,9 +374,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()
|
||||
|
||||
@@ -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_BUYER_REPOSITORY_H
|
||||
@@ -65,21 +48,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("buyer");
|
||||
@@ -99,7 +67,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,10 +100,11 @@ public:
|
||||
}
|
||||
|
||||
static Buyer FindOne(
|
||||
Database& db,
|
||||
int buyer_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -161,10 +130,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int buyer_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -177,6 +147,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Buyer buyer_entry
|
||||
)
|
||||
{
|
||||
@@ -191,7 +162,7 @@ public:
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(buyer_entry.quantity));
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(buyer_entry.price));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -205,6 +176,7 @@ public:
|
||||
}
|
||||
|
||||
static Buyer InsertOne(
|
||||
Database& db,
|
||||
Buyer buyer_entry
|
||||
)
|
||||
{
|
||||
@@ -217,7 +189,7 @@ public:
|
||||
insert_values.push_back(std::to_string(buyer_entry.quantity));
|
||||
insert_values.push_back(std::to_string(buyer_entry.price));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -236,6 +208,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Buyer> buyer_entries
|
||||
)
|
||||
{
|
||||
@@ -256,7 +229,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -267,11 +240,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Buyer> All()
|
||||
static std::vector<Buyer> All(Database& db)
|
||||
{
|
||||
std::vector<Buyer> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -296,11 +269,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Buyer> GetWhere(std::string where_filter)
|
||||
static std::vector<Buyer> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Buyer> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -326,9 +299,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(),
|
||||
@@ -339,9 +312,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()
|
||||
|
||||
@@ -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_CHAR_CREATE_COMBINATIONS_REPOSITORY_H
|
||||
@@ -65,21 +48,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("char_create_combinations");
|
||||
@@ -99,7 +67,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,10 +100,11 @@ public:
|
||||
}
|
||||
|
||||
static CharCreateCombinations FindOne(
|
||||
Database& db,
|
||||
int char_create_combinations_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -161,10 +130,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int char_create_combinations_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -177,6 +147,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharCreateCombinations char_create_combinations_entry
|
||||
)
|
||||
{
|
||||
@@ -191,7 +162,7 @@ public:
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(char_create_combinations_entry.start_zone));
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(char_create_combinations_entry.expansions_req));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -205,6 +176,7 @@ public:
|
||||
}
|
||||
|
||||
static CharCreateCombinations InsertOne(
|
||||
Database& db,
|
||||
CharCreateCombinations char_create_combinations_entry
|
||||
)
|
||||
{
|
||||
@@ -217,7 +189,7 @@ public:
|
||||
insert_values.push_back(std::to_string(char_create_combinations_entry.start_zone));
|
||||
insert_values.push_back(std::to_string(char_create_combinations_entry.expansions_req));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -236,6 +208,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharCreateCombinations> char_create_combinations_entries
|
||||
)
|
||||
{
|
||||
@@ -256,7 +229,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -267,11 +240,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharCreateCombinations> All()
|
||||
static std::vector<CharCreateCombinations> All(Database& db)
|
||||
{
|
||||
std::vector<CharCreateCombinations> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -296,11 +269,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharCreateCombinations> GetWhere(std::string where_filter)
|
||||
static std::vector<CharCreateCombinations> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharCreateCombinations> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -326,9 +299,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -339,9 +312,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_CHAR_CREATE_POINT_ALLOCATIONS_REPOSITORY_H
|
||||
@@ -83,21 +66,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("char_create_point_allocations");
|
||||
@@ -117,7 +85,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -159,10 +127,11 @@ public:
|
||||
}
|
||||
|
||||
static CharCreatePointAllocations FindOne(
|
||||
Database& db,
|
||||
int char_create_point_allocations_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -197,10 +166,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int char_create_point_allocations_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -213,6 +183,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharCreatePointAllocations char_create_point_allocations_entry
|
||||
)
|
||||
{
|
||||
@@ -236,7 +207,7 @@ public:
|
||||
update_values.push_back(columns[13] + " = " + std::to_string(char_create_point_allocations_entry.alloc_wis));
|
||||
update_values.push_back(columns[14] + " = " + std::to_string(char_create_point_allocations_entry.alloc_cha));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -250,6 +221,7 @@ public:
|
||||
}
|
||||
|
||||
static CharCreatePointAllocations InsertOne(
|
||||
Database& db,
|
||||
CharCreatePointAllocations char_create_point_allocations_entry
|
||||
)
|
||||
{
|
||||
@@ -271,7 +243,7 @@ public:
|
||||
insert_values.push_back(std::to_string(char_create_point_allocations_entry.alloc_wis));
|
||||
insert_values.push_back(std::to_string(char_create_point_allocations_entry.alloc_cha));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -290,6 +262,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharCreatePointAllocations> char_create_point_allocations_entries
|
||||
)
|
||||
{
|
||||
@@ -319,7 +292,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -330,11 +303,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharCreatePointAllocations> All()
|
||||
static std::vector<CharCreatePointAllocations> All(Database& db)
|
||||
{
|
||||
std::vector<CharCreatePointAllocations> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -368,11 +341,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharCreatePointAllocations> GetWhere(std::string where_filter)
|
||||
static std::vector<CharCreatePointAllocations> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharCreatePointAllocations> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -407,9 +380,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -420,9 +393,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_CHAR_RECIPE_LIST_REPOSITORY_H
|
||||
@@ -59,21 +42,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("char_recipe_list");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharRecipeList FindOne(
|
||||
Database& db,
|
||||
int char_recipe_list_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int char_recipe_list_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharRecipeList char_recipe_list_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(char_recipe_list_entry.recipe_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(char_recipe_list_entry.madecount));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static CharRecipeList InsertOne(
|
||||
Database& db,
|
||||
CharRecipeList char_recipe_list_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(char_recipe_list_entry.recipe_id));
|
||||
insert_values.push_back(std::to_string(char_recipe_list_entry.madecount));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharRecipeList> char_recipe_list_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharRecipeList> All()
|
||||
static std::vector<CharRecipeList> All(Database& db)
|
||||
{
|
||||
std::vector<CharRecipeList> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharRecipeList> GetWhere(std::string where_filter)
|
||||
static std::vector<CharRecipeList> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharRecipeList> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_CHARACTER_ACTIVITIES_REPOSITORY_H
|
||||
@@ -63,21 +46,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("character_activities");
|
||||
@@ -97,7 +65,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,10 +97,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterActivities FindOne(
|
||||
Database& db,
|
||||
int character_activities_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -157,10 +126,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_activities_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -173,6 +143,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterActivities character_activities_entry
|
||||
)
|
||||
{
|
||||
@@ -186,7 +157,7 @@ public:
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(character_activities_entry.donecount));
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(character_activities_entry.completed));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -200,6 +171,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterActivities InsertOne(
|
||||
Database& db,
|
||||
CharacterActivities character_activities_entry
|
||||
)
|
||||
{
|
||||
@@ -211,7 +183,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_activities_entry.donecount));
|
||||
insert_values.push_back(std::to_string(character_activities_entry.completed));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -230,6 +202,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterActivities> character_activities_entries
|
||||
)
|
||||
{
|
||||
@@ -249,7 +222,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -260,11 +233,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterActivities> All()
|
||||
static std::vector<CharacterActivities> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterActivities> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -288,11 +261,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterActivities> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterActivities> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterActivities> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -317,9 +290,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(),
|
||||
@@ -330,9 +303,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()
|
||||
|
||||
@@ -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_CHARACTER_ALT_CURRENCY_REPOSITORY_H
|
||||
@@ -59,21 +42,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("character_alt_currency");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterAltCurrency FindOne(
|
||||
Database& db,
|
||||
int character_alt_currency_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_alt_currency_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterAltCurrency character_alt_currency_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_alt_currency_entry.currency_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_alt_currency_entry.amount));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterAltCurrency InsertOne(
|
||||
Database& db,
|
||||
CharacterAltCurrency character_alt_currency_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_alt_currency_entry.currency_id));
|
||||
insert_values.push_back(std::to_string(character_alt_currency_entry.amount));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterAltCurrency> character_alt_currency_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterAltCurrency> All()
|
||||
static std::vector<CharacterAltCurrency> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterAltCurrency> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterAltCurrency> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterAltCurrency> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterAltCurrency> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_CHARACTER_ALTERNATE_ABILITIES_REPOSITORY_H
|
||||
@@ -61,21 +44,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("character_alternate_abilities");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterAlternateAbilities FindOne(
|
||||
Database& db,
|
||||
int character_alternate_abilities_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_alternate_abilities_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterAlternateAbilities character_alternate_abilities_entry
|
||||
)
|
||||
{
|
||||
@@ -181,7 +152,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_alternate_abilities_entry.aa_value));
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(character_alternate_abilities_entry.charges));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -195,6 +166,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterAlternateAbilities InsertOne(
|
||||
Database& db,
|
||||
CharacterAlternateAbilities character_alternate_abilities_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +177,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_alternate_abilities_entry.aa_value));
|
||||
insert_values.push_back(std::to_string(character_alternate_abilities_entry.charges));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -224,6 +196,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterAlternateAbilities> character_alternate_abilities_entries
|
||||
)
|
||||
{
|
||||
@@ -242,7 +215,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -253,11 +226,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterAlternateAbilities> All()
|
||||
static std::vector<CharacterAlternateAbilities> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterAlternateAbilities> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -280,11 +253,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterAlternateAbilities> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterAlternateAbilities> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterAlternateAbilities> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -308,9 +281,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(),
|
||||
@@ -321,9 +294,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()
|
||||
|
||||
@@ -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_CHARACTER_AURAS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("character_auras");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterAuras FindOne(
|
||||
Database& db,
|
||||
int character_auras_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_auras_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterAuras character_auras_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_auras_entry.slot));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_auras_entry.spell_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterAuras InsertOne(
|
||||
Database& db,
|
||||
CharacterAuras character_auras_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_auras_entry.slot));
|
||||
insert_values.push_back(std::to_string(character_auras_entry.spell_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterAuras> character_auras_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterAuras> All()
|
||||
static std::vector<CharacterAuras> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterAuras> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterAuras> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterAuras> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterAuras> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_CHARACTER_BANDOLIER_REPOSITORY_H
|
||||
@@ -65,21 +48,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("character_bandolier");
|
||||
@@ -99,7 +67,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,10 +100,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterBandolier FindOne(
|
||||
Database& db,
|
||||
int character_bandolier_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -161,10 +130,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_bandolier_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -177,6 +147,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterBandolier character_bandolier_entry
|
||||
)
|
||||
{
|
||||
@@ -191,7 +162,7 @@ public:
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(character_bandolier_entry.icon));
|
||||
update_values.push_back(columns[5] + " = '" + EscapeString(character_bandolier_entry.bandolier_name) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -205,6 +176,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterBandolier InsertOne(
|
||||
Database& db,
|
||||
CharacterBandolier character_bandolier_entry
|
||||
)
|
||||
{
|
||||
@@ -217,7 +189,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_bandolier_entry.icon));
|
||||
insert_values.push_back("'" + EscapeString(character_bandolier_entry.bandolier_name) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -236,6 +208,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterBandolier> character_bandolier_entries
|
||||
)
|
||||
{
|
||||
@@ -256,7 +229,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -267,11 +240,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterBandolier> All()
|
||||
static std::vector<CharacterBandolier> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterBandolier> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -296,11 +269,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterBandolier> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterBandolier> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterBandolier> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -326,9 +299,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(),
|
||||
@@ -339,9 +312,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()
|
||||
|
||||
@@ -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_CHARACTER_BIND_REPOSITORY_H
|
||||
@@ -69,21 +52,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("character_bind");
|
||||
@@ -103,7 +71,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -138,10 +106,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterBind FindOne(
|
||||
Database& db,
|
||||
int character_bind_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -169,10 +138,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_bind_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +155,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterBind character_bind_entry
|
||||
)
|
||||
{
|
||||
@@ -200,7 +171,7 @@ public:
|
||||
update_values.push_back(columns[6] + " = " + std::to_string(character_bind_entry.z));
|
||||
update_values.push_back(columns[7] + " = " + std::to_string(character_bind_entry.heading));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -214,11 +185,13 @@ public:
|
||||
}
|
||||
|
||||
static CharacterBind InsertOne(
|
||||
Database& db,
|
||||
CharacterBind character_bind_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_bind_entry.id));
|
||||
insert_values.push_back(std::to_string(character_bind_entry.slot));
|
||||
insert_values.push_back(std::to_string(character_bind_entry.zone_id));
|
||||
insert_values.push_back(std::to_string(character_bind_entry.instance_id));
|
||||
@@ -227,7 +200,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_bind_entry.z));
|
||||
insert_values.push_back(std::to_string(character_bind_entry.heading));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -246,6 +219,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterBind> character_bind_entries
|
||||
)
|
||||
{
|
||||
@@ -254,6 +228,7 @@ public:
|
||||
for (auto &character_bind_entry: character_bind_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_bind_entry.id));
|
||||
insert_values.push_back(std::to_string(character_bind_entry.slot));
|
||||
insert_values.push_back(std::to_string(character_bind_entry.zone_id));
|
||||
insert_values.push_back(std::to_string(character_bind_entry.instance_id));
|
||||
@@ -267,7 +242,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -278,11 +253,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterBind> All()
|
||||
static std::vector<CharacterBind> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterBind> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -309,11 +284,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterBind> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterBind> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterBind> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -341,9 +316,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(),
|
||||
@@ -354,9 +329,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()
|
||||
|
||||
@@ -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_CHARACTER_BUFFS_REPOSITORY_H
|
||||
@@ -87,21 +70,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("character_buffs");
|
||||
@@ -121,7 +89,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -165,10 +133,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterBuffs FindOne(
|
||||
Database& db,
|
||||
int character_buffs_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -205,10 +174,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_buffs_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -221,6 +191,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterBuffs character_buffs_entry
|
||||
)
|
||||
{
|
||||
@@ -246,7 +217,7 @@ public:
|
||||
update_values.push_back(columns[15] + " = " + std::to_string(character_buffs_entry.ExtraDIChance));
|
||||
update_values.push_back(columns[16] + " = " + std::to_string(character_buffs_entry.instrument_mod));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -260,6 +231,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterBuffs InsertOne(
|
||||
Database& db,
|
||||
CharacterBuffs character_buffs_entry
|
||||
)
|
||||
{
|
||||
@@ -283,7 +255,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_buffs_entry.ExtraDIChance));
|
||||
insert_values.push_back(std::to_string(character_buffs_entry.instrument_mod));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -302,6 +274,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterBuffs> character_buffs_entries
|
||||
)
|
||||
{
|
||||
@@ -333,7 +306,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -344,11 +317,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterBuffs> All()
|
||||
static std::vector<CharacterBuffs> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterBuffs> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -384,11 +357,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterBuffs> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterBuffs> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterBuffs> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -425,9 +398,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(),
|
||||
@@ -438,9 +411,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()
|
||||
|
||||
@@ -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_CHARACTER_CORPSE_ITEMS_REPOSITORY_H
|
||||
@@ -75,21 +58,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("character_corpse_items");
|
||||
@@ -109,7 +77,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -147,10 +115,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterCorpseItems FindOne(
|
||||
Database& db,
|
||||
int character_corpse_items_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -181,10 +150,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_corpse_items_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -197,6 +167,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterCorpseItems character_corpse_items_entry
|
||||
)
|
||||
{
|
||||
@@ -216,7 +187,7 @@ public:
|
||||
update_values.push_back(columns[9] + " = " + std::to_string(character_corpse_items_entry.aug_6));
|
||||
update_values.push_back(columns[10] + " = " + std::to_string(character_corpse_items_entry.attuned));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -230,6 +201,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterCorpseItems InsertOne(
|
||||
Database& db,
|
||||
CharacterCorpseItems character_corpse_items_entry
|
||||
)
|
||||
{
|
||||
@@ -247,7 +219,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_corpse_items_entry.aug_6));
|
||||
insert_values.push_back(std::to_string(character_corpse_items_entry.attuned));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -266,6 +238,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterCorpseItems> character_corpse_items_entries
|
||||
)
|
||||
{
|
||||
@@ -291,7 +264,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -302,11 +275,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterCorpseItems> All()
|
||||
static std::vector<CharacterCorpseItems> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterCorpseItems> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -336,11 +309,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterCorpseItems> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterCorpseItems> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterCorpseItems> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -371,9 +344,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(),
|
||||
@@ -384,9 +357,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()
|
||||
|
||||
@@ -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_CHARACTER_CORPSES_REPOSITORY_H
|
||||
@@ -147,21 +130,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("character_corpses");
|
||||
@@ -181,7 +149,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -255,10 +223,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterCorpses FindOne(
|
||||
Database& db,
|
||||
int character_corpses_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -325,10 +294,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_corpses_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -341,6 +311,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterCorpses character_corpses_entry
|
||||
)
|
||||
{
|
||||
@@ -395,7 +366,7 @@ public:
|
||||
update_values.push_back(columns[45] + " = " + std::to_string(character_corpses_entry.wc_8));
|
||||
update_values.push_back(columns[46] + " = " + std::to_string(character_corpses_entry.wc_9));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -409,11 +380,13 @@ public:
|
||||
}
|
||||
|
||||
static CharacterCorpses InsertOne(
|
||||
Database& db,
|
||||
CharacterCorpses character_corpses_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.id));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.charid));
|
||||
insert_values.push_back("'" + EscapeString(character_corpses_entry.charname) + "'");
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.zone_id));
|
||||
@@ -461,7 +434,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.wc_8));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.wc_9));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -480,6 +453,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterCorpses> character_corpses_entries
|
||||
)
|
||||
{
|
||||
@@ -488,6 +462,7 @@ public:
|
||||
for (auto &character_corpses_entry: character_corpses_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.id));
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.charid));
|
||||
insert_values.push_back("'" + EscapeString(character_corpses_entry.charname) + "'");
|
||||
insert_values.push_back(std::to_string(character_corpses_entry.zone_id));
|
||||
@@ -540,7 +515,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -551,11 +526,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterCorpses> All()
|
||||
static std::vector<CharacterCorpses> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterCorpses> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -621,11 +596,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterCorpses> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterCorpses> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterCorpses> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -692,9 +667,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(),
|
||||
@@ -705,9 +680,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()
|
||||
|
||||
@@ -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_CHARACTER_CURRENCY_REPOSITORY_H
|
||||
@@ -87,21 +70,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("character_currency");
|
||||
@@ -121,7 +89,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -165,10 +133,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterCurrency FindOne(
|
||||
Database& db,
|
||||
int character_currency_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -205,10 +174,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_currency_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -221,6 +191,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterCurrency character_currency_entry
|
||||
)
|
||||
{
|
||||
@@ -246,7 +217,7 @@ public:
|
||||
update_values.push_back(columns[15] + " = " + std::to_string(character_currency_entry.ebon_crystals));
|
||||
update_values.push_back(columns[16] + " = " + std::to_string(character_currency_entry.career_ebon_crystals));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -260,6 +231,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterCurrency InsertOne(
|
||||
Database& db,
|
||||
CharacterCurrency character_currency_entry
|
||||
)
|
||||
{
|
||||
@@ -283,7 +255,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_currency_entry.ebon_crystals));
|
||||
insert_values.push_back(std::to_string(character_currency_entry.career_ebon_crystals));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -302,6 +274,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterCurrency> character_currency_entries
|
||||
)
|
||||
{
|
||||
@@ -333,7 +306,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -344,11 +317,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterCurrency> All()
|
||||
static std::vector<CharacterCurrency> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterCurrency> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -384,11 +357,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterCurrency> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterCurrency> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterCurrency> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -425,9 +398,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(),
|
||||
@@ -438,9 +411,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()
|
||||
|
||||
@@ -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_CHARACTER_DATA_REPOSITORY_H
|
||||
@@ -257,21 +240,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("character_data");
|
||||
@@ -291,7 +259,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -420,10 +388,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterData FindOne(
|
||||
Database& db,
|
||||
int character_data_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -545,10 +514,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_data_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -561,6 +531,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterData character_data_entry
|
||||
)
|
||||
{
|
||||
@@ -670,7 +641,7 @@ public:
|
||||
update_values.push_back(columns[100] + " = " + std::to_string(character_data_entry.e_last_invsnapshot));
|
||||
update_values.push_back(columns[101] + " = '" + EscapeString(character_data_entry.deleted_at) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -684,11 +655,13 @@ public:
|
||||
}
|
||||
|
||||
static CharacterData InsertOne(
|
||||
Database& db,
|
||||
CharacterData character_data_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_data_entry.id));
|
||||
insert_values.push_back(std::to_string(character_data_entry.account_id));
|
||||
insert_values.push_back("'" + EscapeString(character_data_entry.name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_data_entry.last_name) + "'");
|
||||
@@ -791,7 +764,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_data_entry.e_last_invsnapshot));
|
||||
insert_values.push_back("'" + EscapeString(character_data_entry.deleted_at) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -810,6 +783,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterData> character_data_entries
|
||||
)
|
||||
{
|
||||
@@ -818,6 +792,7 @@ public:
|
||||
for (auto &character_data_entry: character_data_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_data_entry.id));
|
||||
insert_values.push_back(std::to_string(character_data_entry.account_id));
|
||||
insert_values.push_back("'" + EscapeString(character_data_entry.name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_data_entry.last_name) + "'");
|
||||
@@ -925,7 +900,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -936,11 +911,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterData> All()
|
||||
static std::vector<CharacterData> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterData> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -1061,11 +1036,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterData> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterData> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterData> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -1187,9 +1162,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(),
|
||||
@@ -1200,9 +1175,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()
|
||||
|
||||
@@ -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_CHARACTER_DISCIPLINES_REPOSITORY_H
|
||||
@@ -59,21 +42,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("character_disciplines");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterDisciplines FindOne(
|
||||
Database& db,
|
||||
int character_disciplines_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_disciplines_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterDisciplines character_disciplines_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_disciplines_entry.slot_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_disciplines_entry.disc_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterDisciplines InsertOne(
|
||||
Database& db,
|
||||
CharacterDisciplines character_disciplines_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_disciplines_entry.slot_id));
|
||||
insert_values.push_back(std::to_string(character_disciplines_entry.disc_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterDisciplines> character_disciplines_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterDisciplines> All()
|
||||
static std::vector<CharacterDisciplines> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterDisciplines> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterDisciplines> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterDisciplines> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterDisciplines> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_CHARACTER_EXPEDITION_LOCKOUTS_REPOSITORY_H
|
||||
#define EQEMU_BASE_CHARACTER_EXPEDITION_LOCKOUTS_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
|
||||
class BaseCharacterExpeditionLockoutsRepository {
|
||||
public:
|
||||
struct CharacterExpeditionLockouts {
|
||||
int id;
|
||||
int character_id;
|
||||
std::string expedition_name;
|
||||
std::string event_name;
|
||||
std::string expire_time;
|
||||
int duration;
|
||||
std::string from_expedition_uuid;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"character_id",
|
||||
"expedition_name",
|
||||
"event_name",
|
||||
"expire_time",
|
||||
"duration",
|
||||
"from_expedition_uuid",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_expedition_lockouts");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static CharacterExpeditionLockouts NewEntity()
|
||||
{
|
||||
CharacterExpeditionLockouts entry{};
|
||||
|
||||
entry.id = 0;
|
||||
entry.character_id = 0;
|
||||
entry.expedition_name = "";
|
||||
entry.event_name = "";
|
||||
entry.expire_time = current_timestamp();
|
||||
entry.duration = 0;
|
||||
entry.from_expedition_uuid = "";
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
static CharacterExpeditionLockouts GetCharacterExpeditionLockoutsEntry(
|
||||
const std::vector<CharacterExpeditionLockouts> &character_expedition_lockoutss,
|
||||
int character_expedition_lockouts_id
|
||||
)
|
||||
{
|
||||
for (auto &character_expedition_lockouts : character_expedition_lockoutss) {
|
||||
if (character_expedition_lockouts.id == character_expedition_lockouts_id) {
|
||||
return character_expedition_lockouts;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static CharacterExpeditionLockouts FindOne(
|
||||
Database& db,
|
||||
int character_expedition_lockouts_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
character_expedition_lockouts_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
CharacterExpeditionLockouts entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.character_id = atoi(row[1]);
|
||||
entry.expedition_name = row[2] ? row[2] : "";
|
||||
entry.event_name = row[3] ? row[3] : "";
|
||||
entry.expire_time = row[4] ? row[4] : "";
|
||||
entry.duration = atoi(row[5]);
|
||||
entry.from_expedition_uuid = row[6] ? row[6] : "";
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_expedition_lockouts_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
character_expedition_lockouts_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterExpeditionLockouts character_expedition_lockouts_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> update_values;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_expedition_lockouts_entry.character_id));
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(character_expedition_lockouts_entry.expedition_name) + "'");
|
||||
update_values.push_back(columns[3] + " = '" + EscapeString(character_expedition_lockouts_entry.event_name) + "'");
|
||||
update_values.push_back(columns[4] + " = '" + EscapeString(character_expedition_lockouts_entry.expire_time) + "'");
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(character_expedition_lockouts_entry.duration));
|
||||
update_values.push_back(columns[6] + " = '" + EscapeString(character_expedition_lockouts_entry.from_expedition_uuid) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
character_expedition_lockouts_entry.id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static CharacterExpeditionLockouts InsertOne(
|
||||
Database& db,
|
||||
CharacterExpeditionLockouts character_expedition_lockouts_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.id));
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.character_id));
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expedition_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.event_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expire_time) + "'");
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.duration));
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.from_expedition_uuid) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
implode(",", insert_values)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
character_expedition_lockouts_entry.id = results.LastInsertedID();
|
||||
return character_expedition_lockouts_entry;
|
||||
}
|
||||
|
||||
character_expedition_lockouts_entry = NewEntity();
|
||||
|
||||
return character_expedition_lockouts_entry;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterExpeditionLockouts> character_expedition_lockouts_entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &character_expedition_lockouts_entry: character_expedition_lockouts_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.id));
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.character_id));
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expedition_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.event_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expire_time) + "'");
|
||||
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.duration));
|
||||
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.from_expedition_uuid) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterExpeditionLockouts> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterExpeditionLockouts> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
CharacterExpeditionLockouts entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.character_id = atoi(row[1]);
|
||||
entry.expedition_name = row[2] ? row[2] : "";
|
||||
entry.event_name = row[3] ? row[3] : "";
|
||||
entry.expire_time = row[4] ? row[4] : "";
|
||||
entry.duration = atoi(row[5]);
|
||||
entry.from_expedition_uuid = row[6] ? row[6] : "";
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterExpeditionLockouts> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterExpeditionLockouts> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
CharacterExpeditionLockouts entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.character_id = atoi(row[1]);
|
||||
entry.expedition_name = row[2] ? row[2] : "";
|
||||
entry.event_name = row[3] ? row[3] : "";
|
||||
entry.expire_time = row[4] ? row[4] : "";
|
||||
entry.duration = atoi(row[5]);
|
||||
entry.from_expedition_uuid = row[6] ? row[6] : "";
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_CHARACTER_EXPEDITION_LOCKOUTS_REPOSITORY_H
|
||||
@@ -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_CHARACTER_INSPECT_MESSAGES_REPOSITORY_H
|
||||
@@ -57,21 +40,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("character_inspect_messages");
|
||||
@@ -91,7 +59,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -120,10 +88,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterInspectMessages FindOne(
|
||||
Database& db,
|
||||
int character_inspect_messages_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -145,10 +114,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_inspect_messages_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -161,6 +131,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterInspectMessages character_inspect_messages_entry
|
||||
)
|
||||
{
|
||||
@@ -171,7 +142,7 @@ public:
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(character_inspect_messages_entry.id));
|
||||
update_values.push_back(columns[1] + " = '" + EscapeString(character_inspect_messages_entry.inspect_message) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +156,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterInspectMessages InsertOne(
|
||||
Database& db,
|
||||
CharacterInspectMessages character_inspect_messages_entry
|
||||
)
|
||||
{
|
||||
@@ -193,7 +165,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_inspect_messages_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(character_inspect_messages_entry.inspect_message) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -212,6 +184,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterInspectMessages> character_inspect_messages_entries
|
||||
)
|
||||
{
|
||||
@@ -228,7 +201,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -239,11 +212,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterInspectMessages> All()
|
||||
static std::vector<CharacterInspectMessages> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterInspectMessages> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -264,11 +237,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterInspectMessages> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterInspectMessages> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterInspectMessages> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -290,9 +263,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(),
|
||||
@@ -303,9 +276,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()
|
||||
|
||||
@@ -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_CHARACTER_ITEM_RECAST_REPOSITORY_H
|
||||
@@ -59,21 +42,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("character_item_recast");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterItemRecast FindOne(
|
||||
Database& db,
|
||||
int character_item_recast_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_item_recast_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterItemRecast character_item_recast_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_item_recast_entry.recast_type));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_item_recast_entry.timestamp));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterItemRecast InsertOne(
|
||||
Database& db,
|
||||
CharacterItemRecast character_item_recast_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_item_recast_entry.recast_type));
|
||||
insert_values.push_back(std::to_string(character_item_recast_entry.timestamp));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterItemRecast> character_item_recast_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterItemRecast> All()
|
||||
static std::vector<CharacterItemRecast> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterItemRecast> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterItemRecast> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterItemRecast> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterItemRecast> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_CHARACTER_LANGUAGES_REPOSITORY_H
|
||||
@@ -59,21 +42,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("character_languages");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterLanguages FindOne(
|
||||
Database& db,
|
||||
int character_languages_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_languages_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterLanguages character_languages_entry
|
||||
)
|
||||
{
|
||||
@@ -175,7 +146,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_languages_entry.lang_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_languages_entry.value));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,15 +160,17 @@ public:
|
||||
}
|
||||
|
||||
static CharacterLanguages InsertOne(
|
||||
Database& db,
|
||||
CharacterLanguages character_languages_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_languages_entry.id));
|
||||
insert_values.push_back(std::to_string(character_languages_entry.lang_id));
|
||||
insert_values.push_back(std::to_string(character_languages_entry.value));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -216,6 +189,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterLanguages> character_languages_entries
|
||||
)
|
||||
{
|
||||
@@ -224,6 +198,7 @@ public:
|
||||
for (auto &character_languages_entry: character_languages_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_languages_entry.id));
|
||||
insert_values.push_back(std::to_string(character_languages_entry.lang_id));
|
||||
insert_values.push_back(std::to_string(character_languages_entry.value));
|
||||
|
||||
@@ -232,7 +207,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -243,11 +218,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterLanguages> All()
|
||||
static std::vector<CharacterLanguages> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterLanguages> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -269,11 +244,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterLanguages> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterLanguages> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterLanguages> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -296,9 +271,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(),
|
||||
@@ -309,9 +284,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()
|
||||
|
||||
@@ -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_CHARACTER_LEADERSHIP_ABILITIES_REPOSITORY_H
|
||||
@@ -59,21 +42,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("character_leadership_abilities");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterLeadershipAbilities FindOne(
|
||||
Database& db,
|
||||
int character_leadership_abilities_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_leadership_abilities_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterLeadershipAbilities character_leadership_abilities_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_leadership_abilities_entry.slot));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_leadership_abilities_entry.rank));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterLeadershipAbilities InsertOne(
|
||||
Database& db,
|
||||
CharacterLeadershipAbilities character_leadership_abilities_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_leadership_abilities_entry.slot));
|
||||
insert_values.push_back(std::to_string(character_leadership_abilities_entry.rank));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterLeadershipAbilities> character_leadership_abilities_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterLeadershipAbilities> All()
|
||||
static std::vector<CharacterLeadershipAbilities> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterLeadershipAbilities> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterLeadershipAbilities> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterLeadershipAbilities> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterLeadershipAbilities> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_CHARACTER_MATERIAL_REPOSITORY_H
|
||||
@@ -67,21 +50,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("character_material");
|
||||
@@ -101,7 +69,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -135,10 +103,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterMaterial FindOne(
|
||||
Database& db,
|
||||
int character_material_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -165,10 +134,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_material_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -181,6 +151,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterMaterial character_material_entry
|
||||
)
|
||||
{
|
||||
@@ -195,7 +166,7 @@ public:
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(character_material_entry.use_tint));
|
||||
update_values.push_back(columns[6] + " = " + std::to_string(character_material_entry.color));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -209,11 +180,13 @@ public:
|
||||
}
|
||||
|
||||
static CharacterMaterial InsertOne(
|
||||
Database& db,
|
||||
CharacterMaterial character_material_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_material_entry.id));
|
||||
insert_values.push_back(std::to_string(character_material_entry.slot));
|
||||
insert_values.push_back(std::to_string(character_material_entry.blue));
|
||||
insert_values.push_back(std::to_string(character_material_entry.green));
|
||||
@@ -221,7 +194,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_material_entry.use_tint));
|
||||
insert_values.push_back(std::to_string(character_material_entry.color));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -240,6 +213,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterMaterial> character_material_entries
|
||||
)
|
||||
{
|
||||
@@ -248,6 +222,7 @@ public:
|
||||
for (auto &character_material_entry: character_material_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_material_entry.id));
|
||||
insert_values.push_back(std::to_string(character_material_entry.slot));
|
||||
insert_values.push_back(std::to_string(character_material_entry.blue));
|
||||
insert_values.push_back(std::to_string(character_material_entry.green));
|
||||
@@ -260,7 +235,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -271,11 +246,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterMaterial> All()
|
||||
static std::vector<CharacterMaterial> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterMaterial> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -301,11 +276,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterMaterial> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterMaterial> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterMaterial> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -332,9 +307,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(),
|
||||
@@ -345,9 +320,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()
|
||||
|
||||
@@ -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_CHARACTER_MEMMED_SPELLS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("character_memmed_spells");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterMemmedSpells FindOne(
|
||||
Database& db,
|
||||
int character_memmed_spells_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_memmed_spells_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterMemmedSpells character_memmed_spells_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_memmed_spells_entry.slot_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_memmed_spells_entry.spell_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterMemmedSpells InsertOne(
|
||||
Database& db,
|
||||
CharacterMemmedSpells character_memmed_spells_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_memmed_spells_entry.slot_id));
|
||||
insert_values.push_back(std::to_string(character_memmed_spells_entry.spell_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterMemmedSpells> character_memmed_spells_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterMemmedSpells> All()
|
||||
static std::vector<CharacterMemmedSpells> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterMemmedSpells> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterMemmedSpells> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterMemmedSpells> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterMemmedSpells> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_CHARACTER_PET_BUFFS_REPOSITORY_H
|
||||
@@ -75,21 +58,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("character_pet_buffs");
|
||||
@@ -109,7 +77,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -147,10 +115,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterPetBuffs FindOne(
|
||||
Database& db,
|
||||
int character_pet_buffs_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -181,10 +150,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_pet_buffs_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -197,6 +167,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterPetBuffs character_pet_buffs_entry
|
||||
)
|
||||
{
|
||||
@@ -216,7 +187,7 @@ public:
|
||||
update_values.push_back(columns[9] + " = " + std::to_string(character_pet_buffs_entry.rune));
|
||||
update_values.push_back(columns[10] + " = " + std::to_string(character_pet_buffs_entry.instrument_mod));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -230,6 +201,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterPetBuffs InsertOne(
|
||||
Database& db,
|
||||
CharacterPetBuffs character_pet_buffs_entry
|
||||
)
|
||||
{
|
||||
@@ -247,7 +219,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_pet_buffs_entry.rune));
|
||||
insert_values.push_back(std::to_string(character_pet_buffs_entry.instrument_mod));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -266,6 +238,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterPetBuffs> character_pet_buffs_entries
|
||||
)
|
||||
{
|
||||
@@ -291,7 +264,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -302,11 +275,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterPetBuffs> All()
|
||||
static std::vector<CharacterPetBuffs> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterPetBuffs> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -336,11 +309,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterPetBuffs> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterPetBuffs> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterPetBuffs> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -371,9 +344,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(),
|
||||
@@ -384,9 +357,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()
|
||||
|
||||
@@ -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_CHARACTER_PET_INFO_REPOSITORY_H
|
||||
@@ -43,6 +26,7 @@ public:
|
||||
int hp;
|
||||
int mana;
|
||||
float size;
|
||||
int taunting;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -61,6 +45,7 @@ public:
|
||||
"hp",
|
||||
"mana",
|
||||
"size",
|
||||
"taunting",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -69,21 +54,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("character_pet_info");
|
||||
@@ -103,7 +73,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -119,6 +89,7 @@ public:
|
||||
entry.hp = 0;
|
||||
entry.mana = 0;
|
||||
entry.size = 0;
|
||||
entry.taunting = 1;
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -138,10 +109,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterPetInfo FindOne(
|
||||
Database& db,
|
||||
int character_pet_info_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -161,6 +133,7 @@ public:
|
||||
entry.hp = atoi(row[5]);
|
||||
entry.mana = atoi(row[6]);
|
||||
entry.size = static_cast<float>(atof(row[7]));
|
||||
entry.taunting = atoi(row[8]);
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -169,10 +142,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_pet_info_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +159,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterPetInfo character_pet_info_entry
|
||||
)
|
||||
{
|
||||
@@ -200,8 +175,9 @@ public:
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(character_pet_info_entry.hp));
|
||||
update_values.push_back(columns[6] + " = " + std::to_string(character_pet_info_entry.mana));
|
||||
update_values.push_back(columns[7] + " = " + std::to_string(character_pet_info_entry.size));
|
||||
update_values.push_back(columns[8] + " = " + std::to_string(character_pet_info_entry.taunting));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -215,6 +191,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterPetInfo InsertOne(
|
||||
Database& db,
|
||||
CharacterPetInfo character_pet_info_entry
|
||||
)
|
||||
{
|
||||
@@ -228,8 +205,9 @@ public:
|
||||
insert_values.push_back(std::to_string(character_pet_info_entry.hp));
|
||||
insert_values.push_back(std::to_string(character_pet_info_entry.mana));
|
||||
insert_values.push_back(std::to_string(character_pet_info_entry.size));
|
||||
insert_values.push_back(std::to_string(character_pet_info_entry.taunting));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -248,6 +226,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterPetInfo> character_pet_info_entries
|
||||
)
|
||||
{
|
||||
@@ -264,13 +243,14 @@ public:
|
||||
insert_values.push_back(std::to_string(character_pet_info_entry.hp));
|
||||
insert_values.push_back(std::to_string(character_pet_info_entry.mana));
|
||||
insert_values.push_back(std::to_string(character_pet_info_entry.size));
|
||||
insert_values.push_back(std::to_string(character_pet_info_entry.taunting));
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -281,11 +261,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterPetInfo> All()
|
||||
static std::vector<CharacterPetInfo> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterPetInfo> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -305,6 +285,7 @@ public:
|
||||
entry.hp = atoi(row[5]);
|
||||
entry.mana = atoi(row[6]);
|
||||
entry.size = static_cast<float>(atof(row[7]));
|
||||
entry.taunting = atoi(row[8]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
@@ -312,11 +293,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterPetInfo> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterPetInfo> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterPetInfo> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -337,6 +318,7 @@ public:
|
||||
entry.hp = atoi(row[5]);
|
||||
entry.mana = atoi(row[6]);
|
||||
entry.size = static_cast<float>(atof(row[7]));
|
||||
entry.taunting = atoi(row[8]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
@@ -344,9 +326,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(),
|
||||
@@ -357,9 +339,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()
|
||||
|
||||
@@ -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_CHARACTER_PET_INVENTORY_REPOSITORY_H
|
||||
@@ -61,21 +44,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("character_pet_inventory");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterPetInventory FindOne(
|
||||
Database& db,
|
||||
int character_pet_inventory_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_pet_inventory_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterPetInventory character_pet_inventory_entry
|
||||
)
|
||||
{
|
||||
@@ -181,7 +152,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_pet_inventory_entry.slot));
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(character_pet_inventory_entry.item_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -195,6 +166,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterPetInventory InsertOne(
|
||||
Database& db,
|
||||
CharacterPetInventory character_pet_inventory_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +177,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_pet_inventory_entry.slot));
|
||||
insert_values.push_back(std::to_string(character_pet_inventory_entry.item_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -224,6 +196,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterPetInventory> character_pet_inventory_entries
|
||||
)
|
||||
{
|
||||
@@ -242,7 +215,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -253,11 +226,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterPetInventory> All()
|
||||
static std::vector<CharacterPetInventory> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterPetInventory> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -280,11 +253,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterPetInventory> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterPetInventory> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterPetInventory> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -308,9 +281,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(),
|
||||
@@ -321,9 +294,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()
|
||||
|
||||
@@ -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_CHARACTER_POTIONBELT_REPOSITORY_H
|
||||
@@ -61,21 +44,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("character_potionbelt");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterPotionbelt FindOne(
|
||||
Database& db,
|
||||
int character_potionbelt_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_potionbelt_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterPotionbelt character_potionbelt_entry
|
||||
)
|
||||
{
|
||||
@@ -181,7 +152,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_potionbelt_entry.item_id));
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(character_potionbelt_entry.icon));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -195,6 +166,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterPotionbelt InsertOne(
|
||||
Database& db,
|
||||
CharacterPotionbelt character_potionbelt_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +177,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_potionbelt_entry.item_id));
|
||||
insert_values.push_back(std::to_string(character_potionbelt_entry.icon));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -224,6 +196,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterPotionbelt> character_potionbelt_entries
|
||||
)
|
||||
{
|
||||
@@ -242,7 +215,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -253,11 +226,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterPotionbelt> All()
|
||||
static std::vector<CharacterPotionbelt> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterPotionbelt> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -280,11 +253,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterPotionbelt> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterPotionbelt> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterPotionbelt> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -308,9 +281,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(),
|
||||
@@ -321,9 +294,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()
|
||||
|
||||
@@ -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_CHARACTER_SKILLS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("character_skills");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterSkills FindOne(
|
||||
Database& db,
|
||||
int character_skills_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_skills_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterSkills character_skills_entry
|
||||
)
|
||||
{
|
||||
@@ -175,7 +146,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_skills_entry.skill_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_skills_entry.value));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,15 +160,17 @@ public:
|
||||
}
|
||||
|
||||
static CharacterSkills InsertOne(
|
||||
Database& db,
|
||||
CharacterSkills character_skills_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_skills_entry.id));
|
||||
insert_values.push_back(std::to_string(character_skills_entry.skill_id));
|
||||
insert_values.push_back(std::to_string(character_skills_entry.value));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -216,6 +189,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterSkills> character_skills_entries
|
||||
)
|
||||
{
|
||||
@@ -224,6 +198,7 @@ public:
|
||||
for (auto &character_skills_entry: character_skills_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_skills_entry.id));
|
||||
insert_values.push_back(std::to_string(character_skills_entry.skill_id));
|
||||
insert_values.push_back(std::to_string(character_skills_entry.value));
|
||||
|
||||
@@ -232,7 +207,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -243,11 +218,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterSkills> All()
|
||||
static std::vector<CharacterSkills> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterSkills> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -269,11 +244,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterSkills> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterSkills> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterSkills> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -296,9 +271,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(),
|
||||
@@ -309,9 +284,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()
|
||||
|
||||
@@ -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_CHARACTER_SPELLS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("character_spells");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterSpells FindOne(
|
||||
Database& db,
|
||||
int character_spells_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_spells_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterSpells character_spells_entry
|
||||
)
|
||||
{
|
||||
@@ -175,7 +146,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(character_spells_entry.slot_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(character_spells_entry.spell_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,15 +160,17 @@ public:
|
||||
}
|
||||
|
||||
static CharacterSpells InsertOne(
|
||||
Database& db,
|
||||
CharacterSpells character_spells_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_spells_entry.id));
|
||||
insert_values.push_back(std::to_string(character_spells_entry.slot_id));
|
||||
insert_values.push_back(std::to_string(character_spells_entry.spell_id));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -216,6 +189,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterSpells> character_spells_entries
|
||||
)
|
||||
{
|
||||
@@ -224,6 +198,7 @@ public:
|
||||
for (auto &character_spells_entry: character_spells_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(character_spells_entry.id));
|
||||
insert_values.push_back(std::to_string(character_spells_entry.slot_id));
|
||||
insert_values.push_back(std::to_string(character_spells_entry.spell_id));
|
||||
|
||||
@@ -232,7 +207,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -243,11 +218,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterSpells> All()
|
||||
static std::vector<CharacterSpells> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterSpells> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -269,11 +244,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterSpells> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterSpells> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterSpells> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -296,9 +271,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(),
|
||||
@@ -309,9 +284,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()
|
||||
|
||||
@@ -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_CHARACTER_TASKS_REPOSITORY_H
|
||||
@@ -63,21 +46,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("character_tasks");
|
||||
@@ -97,7 +65,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,10 +97,11 @@ public:
|
||||
}
|
||||
|
||||
static CharacterTasks FindOne(
|
||||
Database& db,
|
||||
int character_tasks_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -157,10 +126,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_tasks_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -173,6 +143,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CharacterTasks character_tasks_entry
|
||||
)
|
||||
{
|
||||
@@ -186,7 +157,7 @@ public:
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(character_tasks_entry.type));
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(character_tasks_entry.acceptedtime));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -200,6 +171,7 @@ public:
|
||||
}
|
||||
|
||||
static CharacterTasks InsertOne(
|
||||
Database& db,
|
||||
CharacterTasks character_tasks_entry
|
||||
)
|
||||
{
|
||||
@@ -211,7 +183,7 @@ public:
|
||||
insert_values.push_back(std::to_string(character_tasks_entry.type));
|
||||
insert_values.push_back(std::to_string(character_tasks_entry.acceptedtime));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -230,6 +202,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CharacterTasks> character_tasks_entries
|
||||
)
|
||||
{
|
||||
@@ -249,7 +222,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -260,11 +233,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterTasks> All()
|
||||
static std::vector<CharacterTasks> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterTasks> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -288,11 +261,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterTasks> GetWhere(std::string where_filter)
|
||||
static std::vector<CharacterTasks> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CharacterTasks> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -317,9 +290,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(),
|
||||
@@ -330,9 +303,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()
|
||||
|
||||
@@ -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_COMPLETED_TASKS_REPOSITORY_H
|
||||
@@ -61,21 +44,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("completed_tasks");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static CompletedTasks FindOne(
|
||||
Database& db,
|
||||
int completed_tasks_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int completed_tasks_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
CompletedTasks completed_tasks_entry
|
||||
)
|
||||
{
|
||||
@@ -181,7 +152,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(completed_tasks_entry.taskid));
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(completed_tasks_entry.activityid));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -195,6 +166,7 @@ public:
|
||||
}
|
||||
|
||||
static CompletedTasks InsertOne(
|
||||
Database& db,
|
||||
CompletedTasks completed_tasks_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +177,7 @@ public:
|
||||
insert_values.push_back(std::to_string(completed_tasks_entry.taskid));
|
||||
insert_values.push_back(std::to_string(completed_tasks_entry.activityid));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -224,6 +196,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<CompletedTasks> completed_tasks_entries
|
||||
)
|
||||
{
|
||||
@@ -242,7 +215,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -253,11 +226,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CompletedTasks> All()
|
||||
static std::vector<CompletedTasks> All(Database& db)
|
||||
{
|
||||
std::vector<CompletedTasks> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -280,11 +253,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CompletedTasks> GetWhere(std::string where_filter)
|
||||
static std::vector<CompletedTasks> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<CompletedTasks> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -308,9 +281,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(),
|
||||
@@ -321,9 +294,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()
|
||||
|
||||
@@ -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_CONTENT_FLAGS_REPOSITORY_H
|
||||
@@ -61,21 +44,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("content_flags");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static ContentFlags FindOne(
|
||||
Database& db,
|
||||
int content_flags_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int content_flags_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
ContentFlags content_flags_entry
|
||||
)
|
||||
{
|
||||
@@ -180,7 +151,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(content_flags_entry.enabled));
|
||||
update_values.push_back(columns[3] + " = '" + EscapeString(content_flags_entry.notes) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -194,16 +165,18 @@ public:
|
||||
}
|
||||
|
||||
static ContentFlags InsertOne(
|
||||
Database& db,
|
||||
ContentFlags content_flags_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(content_flags_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(content_flags_entry.flag_name) + "'");
|
||||
insert_values.push_back(std::to_string(content_flags_entry.enabled));
|
||||
insert_values.push_back("'" + EscapeString(content_flags_entry.notes) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -222,6 +195,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<ContentFlags> content_flags_entries
|
||||
)
|
||||
{
|
||||
@@ -230,6 +204,7 @@ public:
|
||||
for (auto &content_flags_entry: content_flags_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(content_flags_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(content_flags_entry.flag_name) + "'");
|
||||
insert_values.push_back(std::to_string(content_flags_entry.enabled));
|
||||
insert_values.push_back("'" + EscapeString(content_flags_entry.notes) + "'");
|
||||
@@ -239,7 +214,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -250,11 +225,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<ContentFlags> All()
|
||||
static std::vector<ContentFlags> All(Database& db)
|
||||
{
|
||||
std::vector<ContentFlags> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -277,11 +252,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<ContentFlags> GetWhere(std::string where_filter)
|
||||
static std::vector<ContentFlags> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<ContentFlags> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -305,9 +280,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 +293,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()
|
||||
|
||||
@@ -0,0 +1,293 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_DAMAGESHIELDTYPES_REPOSITORY_H
|
||||
#define EQEMU_BASE_DAMAGESHIELDTYPES_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
|
||||
class BaseDamageshieldtypesRepository {
|
||||
public:
|
||||
struct Damageshieldtypes {
|
||||
int spellid;
|
||||
int type;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("spellid");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"spellid",
|
||||
"type",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("damageshieldtypes");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static Damageshieldtypes NewEntity()
|
||||
{
|
||||
Damageshieldtypes entry{};
|
||||
|
||||
entry.spellid = 0;
|
||||
entry.type = 0;
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
static Damageshieldtypes GetDamageshieldtypesEntry(
|
||||
const std::vector<Damageshieldtypes> &damageshieldtypess,
|
||||
int damageshieldtypes_id
|
||||
)
|
||||
{
|
||||
for (auto &damageshieldtypes : damageshieldtypess) {
|
||||
if (damageshieldtypes.spellid == damageshieldtypes_id) {
|
||||
return damageshieldtypes;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static Damageshieldtypes FindOne(
|
||||
Database& db,
|
||||
int damageshieldtypes_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
damageshieldtypes_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
Damageshieldtypes entry{};
|
||||
|
||||
entry.spellid = atoi(row[0]);
|
||||
entry.type = atoi(row[1]);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int damageshieldtypes_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
damageshieldtypes_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Damageshieldtypes damageshieldtypes_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> update_values;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(damageshieldtypes_entry.spellid));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(damageshieldtypes_entry.type));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
damageshieldtypes_entry.spellid
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static Damageshieldtypes InsertOne(
|
||||
Database& db,
|
||||
Damageshieldtypes damageshieldtypes_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(damageshieldtypes_entry.spellid));
|
||||
insert_values.push_back(std::to_string(damageshieldtypes_entry.type));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
implode(",", insert_values)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
damageshieldtypes_entry.spellid = results.LastInsertedID();
|
||||
return damageshieldtypes_entry;
|
||||
}
|
||||
|
||||
damageshieldtypes_entry = NewEntity();
|
||||
|
||||
return damageshieldtypes_entry;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Damageshieldtypes> damageshieldtypes_entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &damageshieldtypes_entry: damageshieldtypes_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(damageshieldtypes_entry.spellid));
|
||||
insert_values.push_back(std::to_string(damageshieldtypes_entry.type));
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Damageshieldtypes> All(Database& db)
|
||||
{
|
||||
std::vector<Damageshieldtypes> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
Damageshieldtypes entry{};
|
||||
|
||||
entry.spellid = atoi(row[0]);
|
||||
entry.type = atoi(row[1]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Damageshieldtypes> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Damageshieldtypes> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
Damageshieldtypes entry{};
|
||||
|
||||
entry.spellid = atoi(row[0]);
|
||||
entry.type = atoi(row[1]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_DAMAGESHIELDTYPES_REPOSITORY_H
|
||||
@@ -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_DATA_BUCKETS_REPOSITORY_H
|
||||
@@ -61,21 +44,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("data_buckets");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static DataBuckets FindOne(
|
||||
Database& db,
|
||||
int data_buckets_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int data_buckets_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
DataBuckets data_buckets_entry
|
||||
)
|
||||
{
|
||||
@@ -180,7 +151,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(data_buckets_entry.value) + "'");
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(data_buckets_entry.expires));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -194,16 +165,18 @@ public:
|
||||
}
|
||||
|
||||
static DataBuckets InsertOne(
|
||||
Database& db,
|
||||
DataBuckets data_buckets_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(data_buckets_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(data_buckets_entry.key) + "'");
|
||||
insert_values.push_back("'" + EscapeString(data_buckets_entry.value) + "'");
|
||||
insert_values.push_back(std::to_string(data_buckets_entry.expires));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -222,6 +195,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<DataBuckets> data_buckets_entries
|
||||
)
|
||||
{
|
||||
@@ -230,6 +204,7 @@ public:
|
||||
for (auto &data_buckets_entry: data_buckets_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(data_buckets_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(data_buckets_entry.key) + "'");
|
||||
insert_values.push_back("'" + EscapeString(data_buckets_entry.value) + "'");
|
||||
insert_values.push_back(std::to_string(data_buckets_entry.expires));
|
||||
@@ -239,7 +214,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -250,11 +225,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<DataBuckets> All()
|
||||
static std::vector<DataBuckets> All(Database& db)
|
||||
{
|
||||
std::vector<DataBuckets> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -277,11 +252,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<DataBuckets> GetWhere(std::string where_filter)
|
||||
static std::vector<DataBuckets> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<DataBuckets> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -305,9 +280,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 +293,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()
|
||||
|
||||
@@ -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_DB_STR_REPOSITORY_H
|
||||
@@ -59,21 +42,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("db_str");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static DbStr FindOne(
|
||||
Database& db,
|
||||
int db_str_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int db_str_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
DbStr db_str_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
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(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static DbStr InsertOne(
|
||||
Database& db,
|
||||
DbStr db_str_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(db_str_entry.type));
|
||||
insert_values.push_back("'" + EscapeString(db_str_entry.value) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<DbStr> db_str_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<DbStr> All()
|
||||
static std::vector<DbStr> All(Database& db)
|
||||
{
|
||||
std::vector<DbStr> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<DbStr> GetWhere(std::string where_filter)
|
||||
static std::vector<DbStr> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<DbStr> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_DISCOVERED_ITEMS_REPOSITORY_H
|
||||
@@ -61,21 +44,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("discovered_items");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static DiscoveredItems FindOne(
|
||||
Database& db,
|
||||
int discovered_items_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int discovered_items_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
DiscoveredItems discovered_items_entry
|
||||
)
|
||||
{
|
||||
@@ -181,7 +152,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(discovered_items_entry.discovered_date));
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(discovered_items_entry.account_status));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -195,6 +166,7 @@ public:
|
||||
}
|
||||
|
||||
static DiscoveredItems InsertOne(
|
||||
Database& db,
|
||||
DiscoveredItems discovered_items_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +177,7 @@ public:
|
||||
insert_values.push_back(std::to_string(discovered_items_entry.discovered_date));
|
||||
insert_values.push_back(std::to_string(discovered_items_entry.account_status));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -224,6 +196,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<DiscoveredItems> discovered_items_entries
|
||||
)
|
||||
{
|
||||
@@ -242,7 +215,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -253,11 +226,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<DiscoveredItems> All()
|
||||
static std::vector<DiscoveredItems> All(Database& db)
|
||||
{
|
||||
std::vector<DiscoveredItems> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -280,11 +253,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<DiscoveredItems> GetWhere(std::string where_filter)
|
||||
static std::vector<DiscoveredItems> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<DiscoveredItems> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -308,9 +281,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(),
|
||||
@@ -321,9 +294,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()
|
||||
|
||||
@@ -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_DOORS_REPOSITORY_H
|
||||
@@ -70,6 +53,7 @@ public:
|
||||
int max_expansion;
|
||||
std::string content_flags;
|
||||
std::string content_flags_disabled;
|
||||
int is_instance_door;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -115,6 +99,7 @@ public:
|
||||
"max_expansion",
|
||||
"content_flags",
|
||||
"content_flags_disabled",
|
||||
"is_instance_door",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -123,21 +108,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("doors");
|
||||
@@ -157,7 +127,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -200,6 +170,7 @@ public:
|
||||
entry.max_expansion = 0;
|
||||
entry.content_flags = "";
|
||||
entry.content_flags_disabled = "";
|
||||
entry.is_instance_door = 0;
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -219,10 +190,11 @@ public:
|
||||
}
|
||||
|
||||
static Doors FindOne(
|
||||
Database& db,
|
||||
int doors_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -269,6 +241,7 @@ public:
|
||||
entry.max_expansion = atoi(row[32]);
|
||||
entry.content_flags = row[33] ? row[33] : "";
|
||||
entry.content_flags_disabled = row[34] ? row[34] : "";
|
||||
entry.is_instance_door = atoi(row[35]);
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -277,10 +250,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int doors_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -293,6 +267,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Doors doors_entry
|
||||
)
|
||||
{
|
||||
@@ -334,8 +309,9 @@ public:
|
||||
update_values.push_back(columns[32] + " = " + std::to_string(doors_entry.max_expansion));
|
||||
update_values.push_back(columns[33] + " = '" + EscapeString(doors_entry.content_flags) + "'");
|
||||
update_values.push_back(columns[34] + " = '" + EscapeString(doors_entry.content_flags_disabled) + "'");
|
||||
update_values.push_back(columns[35] + " = " + std::to_string(doors_entry.is_instance_door));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -349,11 +325,13 @@ public:
|
||||
}
|
||||
|
||||
static Doors InsertOne(
|
||||
Database& db,
|
||||
Doors doors_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(doors_entry.id));
|
||||
insert_values.push_back(std::to_string(doors_entry.doorid));
|
||||
insert_values.push_back("'" + EscapeString(doors_entry.zone) + "'");
|
||||
insert_values.push_back(std::to_string(doors_entry.version));
|
||||
@@ -388,8 +366,9 @@ public:
|
||||
insert_values.push_back(std::to_string(doors_entry.max_expansion));
|
||||
insert_values.push_back("'" + EscapeString(doors_entry.content_flags) + "'");
|
||||
insert_values.push_back("'" + EscapeString(doors_entry.content_flags_disabled) + "'");
|
||||
insert_values.push_back(std::to_string(doors_entry.is_instance_door));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -408,6 +387,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Doors> doors_entries
|
||||
)
|
||||
{
|
||||
@@ -416,6 +396,7 @@ public:
|
||||
for (auto &doors_entry: doors_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(doors_entry.id));
|
||||
insert_values.push_back(std::to_string(doors_entry.doorid));
|
||||
insert_values.push_back("'" + EscapeString(doors_entry.zone) + "'");
|
||||
insert_values.push_back(std::to_string(doors_entry.version));
|
||||
@@ -450,13 +431,14 @@ public:
|
||||
insert_values.push_back(std::to_string(doors_entry.max_expansion));
|
||||
insert_values.push_back("'" + EscapeString(doors_entry.content_flags) + "'");
|
||||
insert_values.push_back("'" + EscapeString(doors_entry.content_flags_disabled) + "'");
|
||||
insert_values.push_back(std::to_string(doors_entry.is_instance_door));
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -467,11 +449,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Doors> All()
|
||||
static std::vector<Doors> All(Database& db)
|
||||
{
|
||||
std::vector<Doors> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -518,6 +500,7 @@ public:
|
||||
entry.max_expansion = atoi(row[32]);
|
||||
entry.content_flags = row[33] ? row[33] : "";
|
||||
entry.content_flags_disabled = row[34] ? row[34] : "";
|
||||
entry.is_instance_door = atoi(row[35]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
@@ -525,11 +508,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Doors> GetWhere(std::string where_filter)
|
||||
static std::vector<Doors> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Doors> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -577,6 +560,7 @@ public:
|
||||
entry.max_expansion = atoi(row[32]);
|
||||
entry.content_flags = row[33] ? row[33] : "";
|
||||
entry.content_flags_disabled = row[34] ? row[34] : "";
|
||||
entry.is_instance_door = atoi(row[35]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
@@ -584,9 +568,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -597,9 +581,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -0,0 +1,427 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_DYNAMIC_ZONES_REPOSITORY_H
|
||||
#define EQEMU_BASE_DYNAMIC_ZONES_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
|
||||
class BaseDynamicZonesRepository {
|
||||
public:
|
||||
struct DynamicZones {
|
||||
int id;
|
||||
int instance_id;
|
||||
int type;
|
||||
int compass_zone_id;
|
||||
float compass_x;
|
||||
float compass_y;
|
||||
float compass_z;
|
||||
int safe_return_zone_id;
|
||||
float safe_return_x;
|
||||
float safe_return_y;
|
||||
float safe_return_z;
|
||||
float safe_return_heading;
|
||||
float zone_in_x;
|
||||
float zone_in_y;
|
||||
float zone_in_z;
|
||||
float zone_in_heading;
|
||||
int has_zone_in;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"instance_id",
|
||||
"type",
|
||||
"compass_zone_id",
|
||||
"compass_x",
|
||||
"compass_y",
|
||||
"compass_z",
|
||||
"safe_return_zone_id",
|
||||
"safe_return_x",
|
||||
"safe_return_y",
|
||||
"safe_return_z",
|
||||
"safe_return_heading",
|
||||
"zone_in_x",
|
||||
"zone_in_y",
|
||||
"zone_in_z",
|
||||
"zone_in_heading",
|
||||
"has_zone_in",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("dynamic_zones");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static DynamicZones NewEntity()
|
||||
{
|
||||
DynamicZones entry{};
|
||||
|
||||
entry.id = 0;
|
||||
entry.instance_id = 0;
|
||||
entry.type = 0;
|
||||
entry.compass_zone_id = 0;
|
||||
entry.compass_x = 0;
|
||||
entry.compass_y = 0;
|
||||
entry.compass_z = 0;
|
||||
entry.safe_return_zone_id = 0;
|
||||
entry.safe_return_x = 0;
|
||||
entry.safe_return_y = 0;
|
||||
entry.safe_return_z = 0;
|
||||
entry.safe_return_heading = 0;
|
||||
entry.zone_in_x = 0;
|
||||
entry.zone_in_y = 0;
|
||||
entry.zone_in_z = 0;
|
||||
entry.zone_in_heading = 0;
|
||||
entry.has_zone_in = 0;
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
static DynamicZones GetDynamicZonesEntry(
|
||||
const std::vector<DynamicZones> &dynamic_zoness,
|
||||
int dynamic_zones_id
|
||||
)
|
||||
{
|
||||
for (auto &dynamic_zones : dynamic_zoness) {
|
||||
if (dynamic_zones.id == dynamic_zones_id) {
|
||||
return dynamic_zones;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static DynamicZones FindOne(
|
||||
Database& db,
|
||||
int dynamic_zones_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
dynamic_zones_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
DynamicZones entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.instance_id = atoi(row[1]);
|
||||
entry.type = atoi(row[2]);
|
||||
entry.compass_zone_id = atoi(row[3]);
|
||||
entry.compass_x = static_cast<float>(atof(row[4]));
|
||||
entry.compass_y = static_cast<float>(atof(row[5]));
|
||||
entry.compass_z = static_cast<float>(atof(row[6]));
|
||||
entry.safe_return_zone_id = atoi(row[7]);
|
||||
entry.safe_return_x = static_cast<float>(atof(row[8]));
|
||||
entry.safe_return_y = static_cast<float>(atof(row[9]));
|
||||
entry.safe_return_z = static_cast<float>(atof(row[10]));
|
||||
entry.safe_return_heading = static_cast<float>(atof(row[11]));
|
||||
entry.zone_in_x = static_cast<float>(atof(row[12]));
|
||||
entry.zone_in_y = static_cast<float>(atof(row[13]));
|
||||
entry.zone_in_z = static_cast<float>(atof(row[14]));
|
||||
entry.zone_in_heading = static_cast<float>(atof(row[15]));
|
||||
entry.has_zone_in = atoi(row[16]);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int dynamic_zones_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
dynamic_zones_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
DynamicZones dynamic_zones_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> update_values;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(dynamic_zones_entry.instance_id));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(dynamic_zones_entry.type));
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(dynamic_zones_entry.compass_zone_id));
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(dynamic_zones_entry.compass_x));
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(dynamic_zones_entry.compass_y));
|
||||
update_values.push_back(columns[6] + " = " + std::to_string(dynamic_zones_entry.compass_z));
|
||||
update_values.push_back(columns[7] + " = " + std::to_string(dynamic_zones_entry.safe_return_zone_id));
|
||||
update_values.push_back(columns[8] + " = " + std::to_string(dynamic_zones_entry.safe_return_x));
|
||||
update_values.push_back(columns[9] + " = " + std::to_string(dynamic_zones_entry.safe_return_y));
|
||||
update_values.push_back(columns[10] + " = " + std::to_string(dynamic_zones_entry.safe_return_z));
|
||||
update_values.push_back(columns[11] + " = " + std::to_string(dynamic_zones_entry.safe_return_heading));
|
||||
update_values.push_back(columns[12] + " = " + std::to_string(dynamic_zones_entry.zone_in_x));
|
||||
update_values.push_back(columns[13] + " = " + std::to_string(dynamic_zones_entry.zone_in_y));
|
||||
update_values.push_back(columns[14] + " = " + std::to_string(dynamic_zones_entry.zone_in_z));
|
||||
update_values.push_back(columns[15] + " = " + std::to_string(dynamic_zones_entry.zone_in_heading));
|
||||
update_values.push_back(columns[16] + " = " + std::to_string(dynamic_zones_entry.has_zone_in));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
dynamic_zones_entry.id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static DynamicZones InsertOne(
|
||||
Database& db,
|
||||
DynamicZones dynamic_zones_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.id));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.instance_id));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.type));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.compass_zone_id));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.compass_x));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.compass_y));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.compass_z));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_zone_id));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_x));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_y));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_z));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_heading));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.zone_in_x));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.zone_in_y));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.zone_in_z));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.zone_in_heading));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.has_zone_in));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
implode(",", insert_values)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
dynamic_zones_entry.id = results.LastInsertedID();
|
||||
return dynamic_zones_entry;
|
||||
}
|
||||
|
||||
dynamic_zones_entry = NewEntity();
|
||||
|
||||
return dynamic_zones_entry;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<DynamicZones> dynamic_zones_entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &dynamic_zones_entry: dynamic_zones_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.id));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.instance_id));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.type));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.compass_zone_id));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.compass_x));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.compass_y));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.compass_z));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_zone_id));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_x));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_y));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_z));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.safe_return_heading));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.zone_in_x));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.zone_in_y));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.zone_in_z));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.zone_in_heading));
|
||||
insert_values.push_back(std::to_string(dynamic_zones_entry.has_zone_in));
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<DynamicZones> All(Database& db)
|
||||
{
|
||||
std::vector<DynamicZones> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
DynamicZones entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.instance_id = atoi(row[1]);
|
||||
entry.type = atoi(row[2]);
|
||||
entry.compass_zone_id = atoi(row[3]);
|
||||
entry.compass_x = static_cast<float>(atof(row[4]));
|
||||
entry.compass_y = static_cast<float>(atof(row[5]));
|
||||
entry.compass_z = static_cast<float>(atof(row[6]));
|
||||
entry.safe_return_zone_id = atoi(row[7]);
|
||||
entry.safe_return_x = static_cast<float>(atof(row[8]));
|
||||
entry.safe_return_y = static_cast<float>(atof(row[9]));
|
||||
entry.safe_return_z = static_cast<float>(atof(row[10]));
|
||||
entry.safe_return_heading = static_cast<float>(atof(row[11]));
|
||||
entry.zone_in_x = static_cast<float>(atof(row[12]));
|
||||
entry.zone_in_y = static_cast<float>(atof(row[13]));
|
||||
entry.zone_in_z = static_cast<float>(atof(row[14]));
|
||||
entry.zone_in_heading = static_cast<float>(atof(row[15]));
|
||||
entry.has_zone_in = atoi(row[16]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<DynamicZones> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<DynamicZones> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
DynamicZones entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.instance_id = atoi(row[1]);
|
||||
entry.type = atoi(row[2]);
|
||||
entry.compass_zone_id = atoi(row[3]);
|
||||
entry.compass_x = static_cast<float>(atof(row[4]));
|
||||
entry.compass_y = static_cast<float>(atof(row[5]));
|
||||
entry.compass_z = static_cast<float>(atof(row[6]));
|
||||
entry.safe_return_zone_id = atoi(row[7]);
|
||||
entry.safe_return_x = static_cast<float>(atof(row[8]));
|
||||
entry.safe_return_y = static_cast<float>(atof(row[9]));
|
||||
entry.safe_return_z = static_cast<float>(atof(row[10]));
|
||||
entry.safe_return_heading = static_cast<float>(atof(row[11]));
|
||||
entry.zone_in_x = static_cast<float>(atof(row[12]));
|
||||
entry.zone_in_y = static_cast<float>(atof(row[13]));
|
||||
entry.zone_in_z = static_cast<float>(atof(row[14]));
|
||||
entry.zone_in_heading = static_cast<float>(atof(row[15]));
|
||||
entry.has_zone_in = atoi(row[16]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_DYNAMIC_ZONES_REPOSITORY_H
|
||||
@@ -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_EVENTLOG_REPOSITORY_H
|
||||
@@ -73,21 +56,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("eventlog");
|
||||
@@ -107,7 +75,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -144,10 +112,11 @@ public:
|
||||
}
|
||||
|
||||
static Eventlog FindOne(
|
||||
Database& db,
|
||||
int eventlog_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -177,10 +146,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int eventlog_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -193,6 +163,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Eventlog eventlog_entry
|
||||
)
|
||||
{
|
||||
@@ -210,7 +181,7 @@ public:
|
||||
update_values.push_back(columns[8] + " = '" + EscapeString(eventlog_entry.description) + "'");
|
||||
update_values.push_back(columns[9] + " = " + std::to_string(eventlog_entry.event_nid));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -224,11 +195,13 @@ public:
|
||||
}
|
||||
|
||||
static Eventlog InsertOne(
|
||||
Database& db,
|
||||
Eventlog eventlog_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(eventlog_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(eventlog_entry.accountname) + "'");
|
||||
insert_values.push_back(std::to_string(eventlog_entry.accountid));
|
||||
insert_values.push_back(std::to_string(eventlog_entry.status));
|
||||
@@ -239,7 +212,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(eventlog_entry.description) + "'");
|
||||
insert_values.push_back(std::to_string(eventlog_entry.event_nid));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -258,6 +231,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Eventlog> eventlog_entries
|
||||
)
|
||||
{
|
||||
@@ -266,6 +240,7 @@ public:
|
||||
for (auto &eventlog_entry: eventlog_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(eventlog_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(eventlog_entry.accountname) + "'");
|
||||
insert_values.push_back(std::to_string(eventlog_entry.accountid));
|
||||
insert_values.push_back(std::to_string(eventlog_entry.status));
|
||||
@@ -281,7 +256,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -292,11 +267,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Eventlog> All()
|
||||
static std::vector<Eventlog> All(Database& db)
|
||||
{
|
||||
std::vector<Eventlog> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -325,11 +300,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Eventlog> GetWhere(std::string where_filter)
|
||||
static std::vector<Eventlog> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Eventlog> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -359,9 +334,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(),
|
||||
@@ -372,9 +347,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()
|
||||
|
||||
@@ -0,0 +1,328 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_EXPEDITION_LOCKOUTS_REPOSITORY_H
|
||||
#define EQEMU_BASE_EXPEDITION_LOCKOUTS_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
|
||||
class BaseExpeditionLockoutsRepository {
|
||||
public:
|
||||
struct ExpeditionLockouts {
|
||||
int id;
|
||||
int expedition_id;
|
||||
std::string event_name;
|
||||
std::string expire_time;
|
||||
int duration;
|
||||
std::string from_expedition_uuid;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"expedition_id",
|
||||
"event_name",
|
||||
"expire_time",
|
||||
"duration",
|
||||
"from_expedition_uuid",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("expedition_lockouts");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static ExpeditionLockouts NewEntity()
|
||||
{
|
||||
ExpeditionLockouts entry{};
|
||||
|
||||
entry.id = 0;
|
||||
entry.expedition_id = 0;
|
||||
entry.event_name = "";
|
||||
entry.expire_time = current_timestamp();
|
||||
entry.duration = 0;
|
||||
entry.from_expedition_uuid = "";
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
static ExpeditionLockouts GetExpeditionLockoutsEntry(
|
||||
const std::vector<ExpeditionLockouts> &expedition_lockoutss,
|
||||
int expedition_lockouts_id
|
||||
)
|
||||
{
|
||||
for (auto &expedition_lockouts : expedition_lockoutss) {
|
||||
if (expedition_lockouts.id == expedition_lockouts_id) {
|
||||
return expedition_lockouts;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static ExpeditionLockouts FindOne(
|
||||
Database& db,
|
||||
int expedition_lockouts_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
expedition_lockouts_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
ExpeditionLockouts entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.expedition_id = atoi(row[1]);
|
||||
entry.event_name = row[2] ? row[2] : "";
|
||||
entry.expire_time = row[3] ? row[3] : "";
|
||||
entry.duration = atoi(row[4]);
|
||||
entry.from_expedition_uuid = row[5] ? row[5] : "";
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int expedition_lockouts_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
expedition_lockouts_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
ExpeditionLockouts expedition_lockouts_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> update_values;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(expedition_lockouts_entry.expedition_id));
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(expedition_lockouts_entry.event_name) + "'");
|
||||
update_values.push_back(columns[3] + " = '" + EscapeString(expedition_lockouts_entry.expire_time) + "'");
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(expedition_lockouts_entry.duration));
|
||||
update_values.push_back(columns[5] + " = '" + EscapeString(expedition_lockouts_entry.from_expedition_uuid) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
expedition_lockouts_entry.id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static ExpeditionLockouts InsertOne(
|
||||
Database& db,
|
||||
ExpeditionLockouts expedition_lockouts_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(expedition_lockouts_entry.id));
|
||||
insert_values.push_back(std::to_string(expedition_lockouts_entry.expedition_id));
|
||||
insert_values.push_back("'" + EscapeString(expedition_lockouts_entry.event_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(expedition_lockouts_entry.expire_time) + "'");
|
||||
insert_values.push_back(std::to_string(expedition_lockouts_entry.duration));
|
||||
insert_values.push_back("'" + EscapeString(expedition_lockouts_entry.from_expedition_uuid) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
implode(",", insert_values)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
expedition_lockouts_entry.id = results.LastInsertedID();
|
||||
return expedition_lockouts_entry;
|
||||
}
|
||||
|
||||
expedition_lockouts_entry = NewEntity();
|
||||
|
||||
return expedition_lockouts_entry;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<ExpeditionLockouts> expedition_lockouts_entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &expedition_lockouts_entry: expedition_lockouts_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(expedition_lockouts_entry.id));
|
||||
insert_values.push_back(std::to_string(expedition_lockouts_entry.expedition_id));
|
||||
insert_values.push_back("'" + EscapeString(expedition_lockouts_entry.event_name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(expedition_lockouts_entry.expire_time) + "'");
|
||||
insert_values.push_back(std::to_string(expedition_lockouts_entry.duration));
|
||||
insert_values.push_back("'" + EscapeString(expedition_lockouts_entry.from_expedition_uuid) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<ExpeditionLockouts> All(Database& db)
|
||||
{
|
||||
std::vector<ExpeditionLockouts> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
ExpeditionLockouts entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.expedition_id = atoi(row[1]);
|
||||
entry.event_name = row[2] ? row[2] : "";
|
||||
entry.expire_time = row[3] ? row[3] : "";
|
||||
entry.duration = atoi(row[4]);
|
||||
entry.from_expedition_uuid = row[5] ? row[5] : "";
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<ExpeditionLockouts> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<ExpeditionLockouts> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
ExpeditionLockouts entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.expedition_id = atoi(row[1]);
|
||||
entry.event_name = row[2] ? row[2] : "";
|
||||
entry.expire_time = row[3] ? row[3] : "";
|
||||
entry.duration = atoi(row[4]);
|
||||
entry.from_expedition_uuid = row[5] ? row[5] : "";
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_EXPEDITION_LOCKOUTS_REPOSITORY_H
|
||||
@@ -0,0 +1,310 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_EXPEDITION_MEMBERS_REPOSITORY_H
|
||||
#define EQEMU_BASE_EXPEDITION_MEMBERS_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
|
||||
class BaseExpeditionMembersRepository {
|
||||
public:
|
||||
struct ExpeditionMembers {
|
||||
int id;
|
||||
int expedition_id;
|
||||
int character_id;
|
||||
int is_current_member;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"expedition_id",
|
||||
"character_id",
|
||||
"is_current_member",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("expedition_members");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static ExpeditionMembers NewEntity()
|
||||
{
|
||||
ExpeditionMembers entry{};
|
||||
|
||||
entry.id = 0;
|
||||
entry.expedition_id = 0;
|
||||
entry.character_id = 0;
|
||||
entry.is_current_member = 1;
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
static ExpeditionMembers GetExpeditionMembersEntry(
|
||||
const std::vector<ExpeditionMembers> &expedition_memberss,
|
||||
int expedition_members_id
|
||||
)
|
||||
{
|
||||
for (auto &expedition_members : expedition_memberss) {
|
||||
if (expedition_members.id == expedition_members_id) {
|
||||
return expedition_members;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static ExpeditionMembers FindOne(
|
||||
Database& db,
|
||||
int expedition_members_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
expedition_members_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
ExpeditionMembers entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.expedition_id = atoi(row[1]);
|
||||
entry.character_id = atoi(row[2]);
|
||||
entry.is_current_member = atoi(row[3]);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int expedition_members_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
expedition_members_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
ExpeditionMembers expedition_members_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> update_values;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(expedition_members_entry.expedition_id));
|
||||
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 = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
expedition_members_entry.id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static ExpeditionMembers InsertOne(
|
||||
Database& db,
|
||||
ExpeditionMembers expedition_members_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(expedition_members_entry.id));
|
||||
insert_values.push_back(std::to_string(expedition_members_entry.expedition_id));
|
||||
insert_values.push_back(std::to_string(expedition_members_entry.character_id));
|
||||
insert_values.push_back(std::to_string(expedition_members_entry.is_current_member));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
implode(",", insert_values)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
expedition_members_entry.id = results.LastInsertedID();
|
||||
return expedition_members_entry;
|
||||
}
|
||||
|
||||
expedition_members_entry = NewEntity();
|
||||
|
||||
return expedition_members_entry;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<ExpeditionMembers> expedition_members_entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &expedition_members_entry: expedition_members_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(expedition_members_entry.id));
|
||||
insert_values.push_back(std::to_string(expedition_members_entry.expedition_id));
|
||||
insert_values.push_back(std::to_string(expedition_members_entry.character_id));
|
||||
insert_values.push_back(std::to_string(expedition_members_entry.is_current_member));
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<ExpeditionMembers> All(Database& db)
|
||||
{
|
||||
std::vector<ExpeditionMembers> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
ExpeditionMembers entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.expedition_id = atoi(row[1]);
|
||||
entry.character_id = atoi(row[2]);
|
||||
entry.is_current_member = atoi(row[3]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<ExpeditionMembers> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<ExpeditionMembers> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
ExpeditionMembers entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.expedition_id = atoi(row[1]);
|
||||
entry.character_id = atoi(row[2]);
|
||||
entry.is_current_member = atoi(row[3]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_EXPEDITION_MEMBERS_REPOSITORY_H
|
||||
@@ -0,0 +1,355 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_EXPEDITIONS_REPOSITORY_H
|
||||
#define EQEMU_BASE_EXPEDITIONS_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../string_util.h"
|
||||
|
||||
class BaseExpeditionsRepository {
|
||||
public:
|
||||
struct Expeditions {
|
||||
int id;
|
||||
std::string uuid;
|
||||
int dynamic_zone_id;
|
||||
std::string expedition_name;
|
||||
int leader_id;
|
||||
int min_players;
|
||||
int max_players;
|
||||
int add_replay_on_join;
|
||||
int is_locked;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"uuid",
|
||||
"dynamic_zone_id",
|
||||
"expedition_name",
|
||||
"leader_id",
|
||||
"min_players",
|
||||
"max_players",
|
||||
"add_replay_on_join",
|
||||
"is_locked",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("expeditions");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
ColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static Expeditions NewEntity()
|
||||
{
|
||||
Expeditions entry{};
|
||||
|
||||
entry.id = 0;
|
||||
entry.uuid = "";
|
||||
entry.dynamic_zone_id = 0;
|
||||
entry.expedition_name = "";
|
||||
entry.leader_id = 0;
|
||||
entry.min_players = 0;
|
||||
entry.max_players = 0;
|
||||
entry.add_replay_on_join = 1;
|
||||
entry.is_locked = 0;
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
static Expeditions GetExpeditionsEntry(
|
||||
const std::vector<Expeditions> &expeditionss,
|
||||
int expeditions_id
|
||||
)
|
||||
{
|
||||
for (auto &expeditions : expeditionss) {
|
||||
if (expeditions.id == expeditions_id) {
|
||||
return expeditions;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static Expeditions FindOne(
|
||||
Database& db,
|
||||
int expeditions_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
expeditions_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
Expeditions entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.uuid = row[1] ? row[1] : "";
|
||||
entry.dynamic_zone_id = atoi(row[2]);
|
||||
entry.expedition_name = row[3] ? row[3] : "";
|
||||
entry.leader_id = atoi(row[4]);
|
||||
entry.min_players = atoi(row[5]);
|
||||
entry.max_players = atoi(row[6]);
|
||||
entry.add_replay_on_join = atoi(row[7]);
|
||||
entry.is_locked = atoi(row[8]);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int expeditions_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
expeditions_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Expeditions expeditions_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> update_values;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
update_values.push_back(columns[1] + " = '" + EscapeString(expeditions_entry.uuid) + "'");
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(expeditions_entry.dynamic_zone_id));
|
||||
update_values.push_back(columns[3] + " = '" + EscapeString(expeditions_entry.expedition_name) + "'");
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(expeditions_entry.leader_id));
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(expeditions_entry.min_players));
|
||||
update_values.push_back(columns[6] + " = " + std::to_string(expeditions_entry.max_players));
|
||||
update_values.push_back(columns[7] + " = " + std::to_string(expeditions_entry.add_replay_on_join));
|
||||
update_values.push_back(columns[8] + " = " + std::to_string(expeditions_entry.is_locked));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
expeditions_entry.id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static Expeditions InsertOne(
|
||||
Database& db,
|
||||
Expeditions expeditions_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(expeditions_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(expeditions_entry.uuid) + "'");
|
||||
insert_values.push_back(std::to_string(expeditions_entry.dynamic_zone_id));
|
||||
insert_values.push_back("'" + EscapeString(expeditions_entry.expedition_name) + "'");
|
||||
insert_values.push_back(std::to_string(expeditions_entry.leader_id));
|
||||
insert_values.push_back(std::to_string(expeditions_entry.min_players));
|
||||
insert_values.push_back(std::to_string(expeditions_entry.max_players));
|
||||
insert_values.push_back(std::to_string(expeditions_entry.add_replay_on_join));
|
||||
insert_values.push_back(std::to_string(expeditions_entry.is_locked));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
implode(",", insert_values)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
expeditions_entry.id = results.LastInsertedID();
|
||||
return expeditions_entry;
|
||||
}
|
||||
|
||||
expeditions_entry = NewEntity();
|
||||
|
||||
return expeditions_entry;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Expeditions> expeditions_entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &expeditions_entry: expeditions_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(expeditions_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(expeditions_entry.uuid) + "'");
|
||||
insert_values.push_back(std::to_string(expeditions_entry.dynamic_zone_id));
|
||||
insert_values.push_back("'" + EscapeString(expeditions_entry.expedition_name) + "'");
|
||||
insert_values.push_back(std::to_string(expeditions_entry.leader_id));
|
||||
insert_values.push_back(std::to_string(expeditions_entry.min_players));
|
||||
insert_values.push_back(std::to_string(expeditions_entry.max_players));
|
||||
insert_values.push_back(std::to_string(expeditions_entry.add_replay_on_join));
|
||||
insert_values.push_back(std::to_string(expeditions_entry.is_locked));
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Expeditions> All(Database& db)
|
||||
{
|
||||
std::vector<Expeditions> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
Expeditions entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.uuid = row[1] ? row[1] : "";
|
||||
entry.dynamic_zone_id = atoi(row[2]);
|
||||
entry.expedition_name = row[3] ? row[3] : "";
|
||||
entry.leader_id = atoi(row[4]);
|
||||
entry.min_players = atoi(row[5]);
|
||||
entry.max_players = atoi(row[6]);
|
||||
entry.add_replay_on_join = atoi(row[7]);
|
||||
entry.is_locked = atoi(row[8]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Expeditions> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Expeditions> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
Expeditions entry{};
|
||||
|
||||
entry.id = atoi(row[0]);
|
||||
entry.uuid = row[1] ? row[1] : "";
|
||||
entry.dynamic_zone_id = atoi(row[2]);
|
||||
entry.expedition_name = row[3] ? row[3] : "";
|
||||
entry.leader_id = atoi(row[4]);
|
||||
entry.min_players = atoi(row[5]);
|
||||
entry.max_players = atoi(row[6]);
|
||||
entry.add_replay_on_join = atoi(row[7]);
|
||||
entry.is_locked = atoi(row[8]);
|
||||
|
||||
all_entries.push_back(entry);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_EXPEDITIONS_REPOSITORY_H
|
||||
@@ -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_FACTION_BASE_DATA_REPOSITORY_H
|
||||
@@ -65,21 +48,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("faction_base_data");
|
||||
@@ -99,7 +67,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,10 +100,11 @@ public:
|
||||
}
|
||||
|
||||
static FactionBaseData FindOne(
|
||||
Database& db,
|
||||
int faction_base_data_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -161,10 +130,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int faction_base_data_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -177,6 +147,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
FactionBaseData faction_base_data_entry
|
||||
)
|
||||
{
|
||||
@@ -191,7 +162,7 @@ public:
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(faction_base_data_entry.unk_hero2));
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(faction_base_data_entry.unk_hero3));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -205,6 +176,7 @@ public:
|
||||
}
|
||||
|
||||
static FactionBaseData InsertOne(
|
||||
Database& db,
|
||||
FactionBaseData faction_base_data_entry
|
||||
)
|
||||
{
|
||||
@@ -217,7 +189,7 @@ public:
|
||||
insert_values.push_back(std::to_string(faction_base_data_entry.unk_hero2));
|
||||
insert_values.push_back(std::to_string(faction_base_data_entry.unk_hero3));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -236,6 +208,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<FactionBaseData> faction_base_data_entries
|
||||
)
|
||||
{
|
||||
@@ -256,7 +229,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -267,11 +240,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<FactionBaseData> All()
|
||||
static std::vector<FactionBaseData> All(Database& db)
|
||||
{
|
||||
std::vector<FactionBaseData> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -296,11 +269,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<FactionBaseData> GetWhere(std::string where_filter)
|
||||
static std::vector<FactionBaseData> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<FactionBaseData> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -326,9 +299,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -339,9 +312,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_FACTION_LIST_MOD_REPOSITORY_H
|
||||
@@ -61,21 +44,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("faction_list_mod");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static FactionListMod FindOne(
|
||||
Database& db,
|
||||
int faction_list_mod_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int faction_list_mod_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
FactionListMod faction_list_mod_entry
|
||||
)
|
||||
{
|
||||
@@ -180,7 +151,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(faction_list_mod_entry.mod));
|
||||
update_values.push_back(columns[3] + " = '" + EscapeString(faction_list_mod_entry.mod_name) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -194,16 +165,18 @@ public:
|
||||
}
|
||||
|
||||
static FactionListMod InsertOne(
|
||||
Database& db,
|
||||
FactionListMod faction_list_mod_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(faction_list_mod_entry.id));
|
||||
insert_values.push_back(std::to_string(faction_list_mod_entry.faction_id));
|
||||
insert_values.push_back(std::to_string(faction_list_mod_entry.mod));
|
||||
insert_values.push_back("'" + EscapeString(faction_list_mod_entry.mod_name) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -222,6 +195,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<FactionListMod> faction_list_mod_entries
|
||||
)
|
||||
{
|
||||
@@ -230,6 +204,7 @@ public:
|
||||
for (auto &faction_list_mod_entry: faction_list_mod_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(faction_list_mod_entry.id));
|
||||
insert_values.push_back(std::to_string(faction_list_mod_entry.faction_id));
|
||||
insert_values.push_back(std::to_string(faction_list_mod_entry.mod));
|
||||
insert_values.push_back("'" + EscapeString(faction_list_mod_entry.mod_name) + "'");
|
||||
@@ -239,7 +214,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -250,11 +225,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<FactionListMod> All()
|
||||
static std::vector<FactionListMod> All(Database& db)
|
||||
{
|
||||
std::vector<FactionListMod> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -277,11 +252,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<FactionListMod> GetWhere(std::string where_filter)
|
||||
static std::vector<FactionListMod> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<FactionListMod> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -305,9 +280,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -318,9 +293,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_FACTION_LIST_REPOSITORY_H
|
||||
@@ -59,21 +42,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("faction_list");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static FactionList FindOne(
|
||||
Database& db,
|
||||
int faction_list_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int faction_list_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
FactionList faction_list_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = '" + EscapeString(faction_list_entry.name) + "'");
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(faction_list_entry.base));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static FactionList InsertOne(
|
||||
Database& db,
|
||||
FactionList faction_list_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(faction_list_entry.name) + "'");
|
||||
insert_values.push_back(std::to_string(faction_list_entry.base));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<FactionList> faction_list_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<FactionList> All()
|
||||
static std::vector<FactionList> All(Database& db)
|
||||
{
|
||||
std::vector<FactionList> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<FactionList> GetWhere(std::string where_filter)
|
||||
static std::vector<FactionList> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<FactionList> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -312,9 +285,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_FACTION_VALUES_REPOSITORY_H
|
||||
@@ -61,21 +44,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("faction_values");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static FactionValues FindOne(
|
||||
Database& db,
|
||||
int faction_values_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int faction_values_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
FactionValues faction_values_entry
|
||||
)
|
||||
{
|
||||
@@ -181,7 +152,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(faction_values_entry.current_value));
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(faction_values_entry.temp));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -195,6 +166,7 @@ public:
|
||||
}
|
||||
|
||||
static FactionValues InsertOne(
|
||||
Database& db,
|
||||
FactionValues faction_values_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +177,7 @@ public:
|
||||
insert_values.push_back(std::to_string(faction_values_entry.current_value));
|
||||
insert_values.push_back(std::to_string(faction_values_entry.temp));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -224,6 +196,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<FactionValues> faction_values_entries
|
||||
)
|
||||
{
|
||||
@@ -242,7 +215,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -253,11 +226,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<FactionValues> All()
|
||||
static std::vector<FactionValues> All(Database& db)
|
||||
{
|
||||
std::vector<FactionValues> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -280,11 +253,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<FactionValues> GetWhere(std::string where_filter)
|
||||
static std::vector<FactionValues> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<FactionValues> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -308,9 +281,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(),
|
||||
@@ -321,9 +294,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()
|
||||
|
||||
@@ -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_FISHING_REPOSITORY_H
|
||||
@@ -75,21 +58,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("fishing");
|
||||
@@ -109,7 +77,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -147,10 +115,11 @@ public:
|
||||
}
|
||||
|
||||
static Fishing FindOne(
|
||||
Database& db,
|
||||
int fishing_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -181,10 +150,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int fishing_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -197,6 +167,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Fishing fishing_entry
|
||||
)
|
||||
{
|
||||
@@ -215,7 +186,7 @@ public:
|
||||
update_values.push_back(columns[9] + " = '" + EscapeString(fishing_entry.content_flags) + "'");
|
||||
update_values.push_back(columns[10] + " = '" + EscapeString(fishing_entry.content_flags_disabled) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -229,11 +200,13 @@ public:
|
||||
}
|
||||
|
||||
static Fishing InsertOne(
|
||||
Database& db,
|
||||
Fishing fishing_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(fishing_entry.id));
|
||||
insert_values.push_back(std::to_string(fishing_entry.zoneid));
|
||||
insert_values.push_back(std::to_string(fishing_entry.Itemid));
|
||||
insert_values.push_back(std::to_string(fishing_entry.skill_level));
|
||||
@@ -245,7 +218,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(fishing_entry.content_flags) + "'");
|
||||
insert_values.push_back("'" + EscapeString(fishing_entry.content_flags_disabled) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -264,6 +237,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Fishing> fishing_entries
|
||||
)
|
||||
{
|
||||
@@ -272,6 +246,7 @@ public:
|
||||
for (auto &fishing_entry: fishing_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(fishing_entry.id));
|
||||
insert_values.push_back(std::to_string(fishing_entry.zoneid));
|
||||
insert_values.push_back(std::to_string(fishing_entry.Itemid));
|
||||
insert_values.push_back(std::to_string(fishing_entry.skill_level));
|
||||
@@ -288,7 +263,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -299,11 +274,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Fishing> All()
|
||||
static std::vector<Fishing> All(Database& db)
|
||||
{
|
||||
std::vector<Fishing> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -333,11 +308,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Fishing> GetWhere(std::string where_filter)
|
||||
static std::vector<Fishing> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Fishing> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -368,9 +343,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -381,9 +356,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_FORAGE_REPOSITORY_H
|
||||
@@ -71,21 +54,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("forage");
|
||||
@@ -105,7 +73,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,10 +109,11 @@ public:
|
||||
}
|
||||
|
||||
static Forage FindOne(
|
||||
Database& db,
|
||||
int forage_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -173,10 +142,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int forage_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,6 +159,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Forage forage_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +176,7 @@ public:
|
||||
update_values.push_back(columns[7] + " = '" + EscapeString(forage_entry.content_flags) + "'");
|
||||
update_values.push_back(columns[8] + " = '" + EscapeString(forage_entry.content_flags_disabled) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -219,11 +190,13 @@ public:
|
||||
}
|
||||
|
||||
static Forage InsertOne(
|
||||
Database& db,
|
||||
Forage forage_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(forage_entry.id));
|
||||
insert_values.push_back(std::to_string(forage_entry.zoneid));
|
||||
insert_values.push_back(std::to_string(forage_entry.Itemid));
|
||||
insert_values.push_back(std::to_string(forage_entry.level));
|
||||
@@ -233,7 +206,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(forage_entry.content_flags) + "'");
|
||||
insert_values.push_back("'" + EscapeString(forage_entry.content_flags_disabled) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -252,6 +225,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Forage> forage_entries
|
||||
)
|
||||
{
|
||||
@@ -260,6 +234,7 @@ public:
|
||||
for (auto &forage_entry: forage_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(forage_entry.id));
|
||||
insert_values.push_back(std::to_string(forage_entry.zoneid));
|
||||
insert_values.push_back(std::to_string(forage_entry.Itemid));
|
||||
insert_values.push_back(std::to_string(forage_entry.level));
|
||||
@@ -274,7 +249,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -285,11 +260,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Forage> All()
|
||||
static std::vector<Forage> All(Database& db)
|
||||
{
|
||||
std::vector<Forage> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -317,11 +292,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Forage> GetWhere(std::string where_filter)
|
||||
static std::vector<Forage> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Forage> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -350,9 +325,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -363,9 +338,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_FRIENDS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("friends");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static Friends FindOne(
|
||||
Database& db,
|
||||
int friends_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int friends_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Friends friends_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(friends_entry.type));
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(friends_entry.name) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static Friends InsertOne(
|
||||
Database& db,
|
||||
Friends friends_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(friends_entry.type));
|
||||
insert_values.push_back("'" + EscapeString(friends_entry.name) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Friends> friends_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Friends> All()
|
||||
static std::vector<Friends> All(Database& db)
|
||||
{
|
||||
std::vector<Friends> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Friends> GetWhere(std::string where_filter)
|
||||
static std::vector<Friends> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Friends> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_GLOBAL_LOOT_REPOSITORY_H
|
||||
@@ -87,21 +70,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("global_loot");
|
||||
@@ -121,7 +89,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -165,10 +133,11 @@ public:
|
||||
}
|
||||
|
||||
static GlobalLoot FindOne(
|
||||
Database& db,
|
||||
int global_loot_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -205,10 +174,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int global_loot_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -221,6 +191,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
GlobalLoot global_loot_entry
|
||||
)
|
||||
{
|
||||
@@ -245,7 +216,7 @@ public:
|
||||
update_values.push_back(columns[15] + " = '" + EscapeString(global_loot_entry.content_flags) + "'");
|
||||
update_values.push_back(columns[16] + " = '" + EscapeString(global_loot_entry.content_flags_disabled) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -259,11 +230,13 @@ public:
|
||||
}
|
||||
|
||||
static GlobalLoot InsertOne(
|
||||
Database& db,
|
||||
GlobalLoot global_loot_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(global_loot_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(global_loot_entry.description) + "'");
|
||||
insert_values.push_back(std::to_string(global_loot_entry.loottable_id));
|
||||
insert_values.push_back(std::to_string(global_loot_entry.enabled));
|
||||
@@ -281,7 +254,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(global_loot_entry.content_flags) + "'");
|
||||
insert_values.push_back("'" + EscapeString(global_loot_entry.content_flags_disabled) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -300,6 +273,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<GlobalLoot> global_loot_entries
|
||||
)
|
||||
{
|
||||
@@ -308,6 +282,7 @@ public:
|
||||
for (auto &global_loot_entry: global_loot_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(global_loot_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(global_loot_entry.description) + "'");
|
||||
insert_values.push_back(std::to_string(global_loot_entry.loottable_id));
|
||||
insert_values.push_back(std::to_string(global_loot_entry.enabled));
|
||||
@@ -330,7 +305,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -341,11 +316,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<GlobalLoot> All()
|
||||
static std::vector<GlobalLoot> All(Database& db)
|
||||
{
|
||||
std::vector<GlobalLoot> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -381,11 +356,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<GlobalLoot> GetWhere(std::string where_filter)
|
||||
static std::vector<GlobalLoot> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<GlobalLoot> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -422,9 +397,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -435,9 +410,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_GM_IPS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("gm_ips");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static GmIps FindOne(
|
||||
Database& db,
|
||||
int gm_ips_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int gm_ips_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
GmIps gm_ips_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(gm_ips_entry.account_id));
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(gm_ips_entry.ip_address) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static GmIps InsertOne(
|
||||
Database& db,
|
||||
GmIps gm_ips_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(gm_ips_entry.account_id));
|
||||
insert_values.push_back("'" + EscapeString(gm_ips_entry.ip_address) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<GmIps> gm_ips_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<GmIps> All()
|
||||
static std::vector<GmIps> All(Database& db)
|
||||
{
|
||||
std::vector<GmIps> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<GmIps> GetWhere(std::string where_filter)
|
||||
static std::vector<GmIps> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<GmIps> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_GOALLISTS_REPOSITORY_H
|
||||
@@ -57,21 +40,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("goallists");
|
||||
@@ -91,7 +59,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -120,10 +88,11 @@ public:
|
||||
}
|
||||
|
||||
static Goallists FindOne(
|
||||
Database& db,
|
||||
int goallists_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -145,10 +114,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int goallists_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -161,6 +131,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Goallists goallists_entry
|
||||
)
|
||||
{
|
||||
@@ -171,7 +142,7 @@ public:
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(goallists_entry.listid));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(goallists_entry.entry));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +156,7 @@ public:
|
||||
}
|
||||
|
||||
static Goallists InsertOne(
|
||||
Database& db,
|
||||
Goallists goallists_entry
|
||||
)
|
||||
{
|
||||
@@ -193,7 +165,7 @@ public:
|
||||
insert_values.push_back(std::to_string(goallists_entry.listid));
|
||||
insert_values.push_back(std::to_string(goallists_entry.entry));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -212,6 +184,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Goallists> goallists_entries
|
||||
)
|
||||
{
|
||||
@@ -228,7 +201,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -239,11 +212,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Goallists> All()
|
||||
static std::vector<Goallists> All(Database& db)
|
||||
{
|
||||
std::vector<Goallists> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -264,11 +237,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Goallists> GetWhere(std::string where_filter)
|
||||
static std::vector<Goallists> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Goallists> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -290,9 +263,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -303,9 +276,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_GRAVEYARD_REPOSITORY_H
|
||||
@@ -65,21 +48,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("graveyard");
|
||||
@@ -99,7 +67,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,10 +100,11 @@ public:
|
||||
}
|
||||
|
||||
static Graveyard FindOne(
|
||||
Database& db,
|
||||
int graveyard_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -161,10 +130,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int graveyard_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -177,6 +147,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Graveyard graveyard_entry
|
||||
)
|
||||
{
|
||||
@@ -190,7 +161,7 @@ public:
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(graveyard_entry.z));
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(graveyard_entry.heading));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -204,18 +175,20 @@ public:
|
||||
}
|
||||
|
||||
static Graveyard InsertOne(
|
||||
Database& db,
|
||||
Graveyard graveyard_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(graveyard_entry.id));
|
||||
insert_values.push_back(std::to_string(graveyard_entry.zone_id));
|
||||
insert_values.push_back(std::to_string(graveyard_entry.x));
|
||||
insert_values.push_back(std::to_string(graveyard_entry.y));
|
||||
insert_values.push_back(std::to_string(graveyard_entry.z));
|
||||
insert_values.push_back(std::to_string(graveyard_entry.heading));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -234,6 +207,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Graveyard> graveyard_entries
|
||||
)
|
||||
{
|
||||
@@ -242,6 +216,7 @@ public:
|
||||
for (auto &graveyard_entry: graveyard_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(graveyard_entry.id));
|
||||
insert_values.push_back(std::to_string(graveyard_entry.zone_id));
|
||||
insert_values.push_back(std::to_string(graveyard_entry.x));
|
||||
insert_values.push_back(std::to_string(graveyard_entry.y));
|
||||
@@ -253,7 +228,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -264,11 +239,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Graveyard> All()
|
||||
static std::vector<Graveyard> All(Database& db)
|
||||
{
|
||||
std::vector<Graveyard> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -293,11 +268,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Graveyard> GetWhere(std::string where_filter)
|
||||
static std::vector<Graveyard> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Graveyard> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -323,9 +298,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -336,9 +311,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_GROUND_SPAWNS_REPOSITORY_H
|
||||
@@ -89,21 +72,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("ground_spawns");
|
||||
@@ -123,7 +91,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -168,10 +136,11 @@ public:
|
||||
}
|
||||
|
||||
static GroundSpawns FindOne(
|
||||
Database& db,
|
||||
int ground_spawns_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -209,10 +178,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int ground_spawns_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -225,6 +195,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
GroundSpawns ground_spawns_entry
|
||||
)
|
||||
{
|
||||
@@ -250,7 +221,7 @@ public:
|
||||
update_values.push_back(columns[16] + " = '" + EscapeString(ground_spawns_entry.content_flags) + "'");
|
||||
update_values.push_back(columns[17] + " = '" + EscapeString(ground_spawns_entry.content_flags_disabled) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -264,11 +235,13 @@ public:
|
||||
}
|
||||
|
||||
static GroundSpawns InsertOne(
|
||||
Database& db,
|
||||
GroundSpawns ground_spawns_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(ground_spawns_entry.id));
|
||||
insert_values.push_back(std::to_string(ground_spawns_entry.zoneid));
|
||||
insert_values.push_back(std::to_string(ground_spawns_entry.version));
|
||||
insert_values.push_back(std::to_string(ground_spawns_entry.max_x));
|
||||
@@ -287,7 +260,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(ground_spawns_entry.content_flags) + "'");
|
||||
insert_values.push_back("'" + EscapeString(ground_spawns_entry.content_flags_disabled) + "'");
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -306,6 +279,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<GroundSpawns> ground_spawns_entries
|
||||
)
|
||||
{
|
||||
@@ -314,6 +288,7 @@ public:
|
||||
for (auto &ground_spawns_entry: ground_spawns_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(ground_spawns_entry.id));
|
||||
insert_values.push_back(std::to_string(ground_spawns_entry.zoneid));
|
||||
insert_values.push_back(std::to_string(ground_spawns_entry.version));
|
||||
insert_values.push_back(std::to_string(ground_spawns_entry.max_x));
|
||||
@@ -337,7 +312,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -348,11 +323,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<GroundSpawns> All()
|
||||
static std::vector<GroundSpawns> All(Database& db)
|
||||
{
|
||||
std::vector<GroundSpawns> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -389,11 +364,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<GroundSpawns> GetWhere(std::string where_filter)
|
||||
static std::vector<GroundSpawns> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<GroundSpawns> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -431,9 +406,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -444,9 +419,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_GROUP_ID_REPOSITORY_H
|
||||
@@ -61,21 +44,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("group_id");
|
||||
@@ -95,7 +63,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,10 +94,11 @@ public:
|
||||
}
|
||||
|
||||
static GroupId FindOne(
|
||||
Database& db,
|
||||
int group_id_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -153,10 +122,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int group_id_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -169,6 +139,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
GroupId group_id_entry
|
||||
)
|
||||
{
|
||||
@@ -181,7 +152,7 @@ public:
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(group_id_entry.name) + "'");
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(group_id_entry.ismerc));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -195,6 +166,7 @@ public:
|
||||
}
|
||||
|
||||
static GroupId InsertOne(
|
||||
Database& db,
|
||||
GroupId group_id_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +177,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(group_id_entry.name) + "'");
|
||||
insert_values.push_back(std::to_string(group_id_entry.ismerc));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -224,6 +196,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<GroupId> group_id_entries
|
||||
)
|
||||
{
|
||||
@@ -242,7 +215,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -253,11 +226,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<GroupId> All()
|
||||
static std::vector<GroupId> All(Database& db)
|
||||
{
|
||||
std::vector<GroupId> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -280,11 +253,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<GroupId> GetWhere(std::string where_filter)
|
||||
static std::vector<GroupId> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<GroupId> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -308,9 +281,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(),
|
||||
@@ -321,9 +294,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()
|
||||
|
||||
@@ -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_GROUP_LEADERS_REPOSITORY_H
|
||||
@@ -71,21 +54,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("group_leaders");
|
||||
@@ -105,7 +73,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,10 +109,11 @@ public:
|
||||
}
|
||||
|
||||
static GroupLeaders FindOne(
|
||||
Database& db,
|
||||
int group_leaders_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -173,10 +142,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int group_leaders_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,6 +159,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
GroupLeaders group_leaders_entry
|
||||
)
|
||||
{
|
||||
@@ -206,7 +177,7 @@ public:
|
||||
update_values.push_back(columns[7] + " = '" + EscapeString(group_leaders_entry.mentoree) + "'");
|
||||
update_values.push_back(columns[8] + " = " + std::to_string(group_leaders_entry.mentor_percent));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -220,6 +191,7 @@ public:
|
||||
}
|
||||
|
||||
static GroupLeaders InsertOne(
|
||||
Database& db,
|
||||
GroupLeaders group_leaders_entry
|
||||
)
|
||||
{
|
||||
@@ -235,7 +207,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(group_leaders_entry.mentoree) + "'");
|
||||
insert_values.push_back(std::to_string(group_leaders_entry.mentor_percent));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -254,6 +226,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<GroupLeaders> group_leaders_entries
|
||||
)
|
||||
{
|
||||
@@ -277,7 +250,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -288,11 +261,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<GroupLeaders> All()
|
||||
static std::vector<GroupLeaders> All(Database& db)
|
||||
{
|
||||
std::vector<GroupLeaders> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -320,11 +293,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<GroupLeaders> GetWhere(std::string where_filter)
|
||||
static std::vector<GroupLeaders> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<GroupLeaders> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -353,9 +326,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(),
|
||||
@@ -366,9 +339,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()
|
||||
|
||||
@@ -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_GUILD_MEMBERS_REPOSITORY_H
|
||||
@@ -71,21 +54,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("guild_members");
|
||||
@@ -105,7 +73,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,10 +109,11 @@ public:
|
||||
}
|
||||
|
||||
static GuildMembers FindOne(
|
||||
Database& db,
|
||||
int guild_members_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -173,10 +142,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int guild_members_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,6 +159,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
GuildMembers guild_members_entry
|
||||
)
|
||||
{
|
||||
@@ -206,7 +177,7 @@ public:
|
||||
update_values.push_back(columns[7] + " = '" + EscapeString(guild_members_entry.public_note) + "'");
|
||||
update_values.push_back(columns[8] + " = " + std::to_string(guild_members_entry.alt));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -220,6 +191,7 @@ public:
|
||||
}
|
||||
|
||||
static GuildMembers InsertOne(
|
||||
Database& db,
|
||||
GuildMembers guild_members_entry
|
||||
)
|
||||
{
|
||||
@@ -235,7 +207,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(guild_members_entry.public_note) + "'");
|
||||
insert_values.push_back(std::to_string(guild_members_entry.alt));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -254,6 +226,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<GuildMembers> guild_members_entries
|
||||
)
|
||||
{
|
||||
@@ -277,7 +250,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -288,11 +261,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<GuildMembers> All()
|
||||
static std::vector<GuildMembers> All(Database& db)
|
||||
{
|
||||
std::vector<GuildMembers> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -320,11 +293,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<GuildMembers> GetWhere(std::string where_filter)
|
||||
static std::vector<GuildMembers> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<GuildMembers> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -353,9 +326,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(),
|
||||
@@ -366,9 +339,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()
|
||||
|
||||
@@ -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_GUILD_RANKS_REPOSITORY_H
|
||||
@@ -75,21 +58,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("guild_ranks");
|
||||
@@ -109,7 +77,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -147,10 +115,11 @@ public:
|
||||
}
|
||||
|
||||
static GuildRanks FindOne(
|
||||
Database& db,
|
||||
int guild_ranks_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -181,10 +150,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int guild_ranks_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -197,6 +167,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
GuildRanks guild_ranks_entry
|
||||
)
|
||||
{
|
||||
@@ -216,7 +187,7 @@ public:
|
||||
update_values.push_back(columns[9] + " = " + std::to_string(guild_ranks_entry.can_motd));
|
||||
update_values.push_back(columns[10] + " = " + std::to_string(guild_ranks_entry.can_warpeace));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -230,6 +201,7 @@ public:
|
||||
}
|
||||
|
||||
static GuildRanks InsertOne(
|
||||
Database& db,
|
||||
GuildRanks guild_ranks_entry
|
||||
)
|
||||
{
|
||||
@@ -247,7 +219,7 @@ public:
|
||||
insert_values.push_back(std::to_string(guild_ranks_entry.can_motd));
|
||||
insert_values.push_back(std::to_string(guild_ranks_entry.can_warpeace));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -266,6 +238,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<GuildRanks> guild_ranks_entries
|
||||
)
|
||||
{
|
||||
@@ -291,7 +264,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -302,11 +275,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<GuildRanks> All()
|
||||
static std::vector<GuildRanks> All(Database& db)
|
||||
{
|
||||
std::vector<GuildRanks> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -336,11 +309,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<GuildRanks> GetWhere(std::string where_filter)
|
||||
static std::vector<GuildRanks> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<GuildRanks> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -371,9 +344,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(),
|
||||
@@ -384,9 +357,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()
|
||||
|
||||
@@ -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_GUILD_RELATIONS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("guild_relations");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static GuildRelations FindOne(
|
||||
Database& db,
|
||||
int guild_relations_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int guild_relations_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
GuildRelations guild_relations_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(guild_relations_entry.guild2));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(guild_relations_entry.relation));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static GuildRelations InsertOne(
|
||||
Database& db,
|
||||
GuildRelations guild_relations_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(guild_relations_entry.guild2));
|
||||
insert_values.push_back(std::to_string(guild_relations_entry.relation));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<GuildRelations> guild_relations_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<GuildRelations> All()
|
||||
static std::vector<GuildRelations> All(Database& db)
|
||||
{
|
||||
std::vector<GuildRelations> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<GuildRelations> GetWhere(std::string where_filter)
|
||||
static std::vector<GuildRelations> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<GuildRelations> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_GUILDS_REPOSITORY_H
|
||||
@@ -71,21 +54,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("guilds");
|
||||
@@ -105,7 +73,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,10 +109,11 @@ public:
|
||||
}
|
||||
|
||||
static Guilds FindOne(
|
||||
Database& db,
|
||||
int guilds_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -173,10 +142,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int guilds_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,6 +159,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Guilds guilds_entry
|
||||
)
|
||||
{
|
||||
@@ -205,7 +176,7 @@ public:
|
||||
update_values.push_back(columns[7] + " = '" + EscapeString(guilds_entry.channel) + "'");
|
||||
update_values.push_back(columns[8] + " = '" + EscapeString(guilds_entry.url) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -219,11 +190,13 @@ public:
|
||||
}
|
||||
|
||||
static Guilds InsertOne(
|
||||
Database& db,
|
||||
Guilds guilds_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(guilds_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(guilds_entry.name) + "'");
|
||||
insert_values.push_back(std::to_string(guilds_entry.leader));
|
||||
insert_values.push_back(std::to_string(guilds_entry.minstatus));
|
||||
@@ -233,7 +206,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(guilds_entry.channel) + "'");
|
||||
insert_values.push_back("'" + EscapeString(guilds_entry.url) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -252,6 +225,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Guilds> guilds_entries
|
||||
)
|
||||
{
|
||||
@@ -260,6 +234,7 @@ public:
|
||||
for (auto &guilds_entry: guilds_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(guilds_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(guilds_entry.name) + "'");
|
||||
insert_values.push_back(std::to_string(guilds_entry.leader));
|
||||
insert_values.push_back(std::to_string(guilds_entry.minstatus));
|
||||
@@ -274,7 +249,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -285,11 +260,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Guilds> All()
|
||||
static std::vector<Guilds> All(Database& db)
|
||||
{
|
||||
std::vector<Guilds> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -317,11 +292,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Guilds> GetWhere(std::string where_filter)
|
||||
static std::vector<Guilds> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Guilds> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -350,9 +325,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(),
|
||||
@@ -363,9 +338,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()
|
||||
|
||||
@@ -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_HACKERS_REPOSITORY_H
|
||||
@@ -65,21 +48,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("hackers");
|
||||
@@ -99,7 +67,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,10 +100,11 @@ public:
|
||||
}
|
||||
|
||||
static Hackers FindOne(
|
||||
Database& db,
|
||||
int hackers_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -161,10 +130,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int hackers_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -177,6 +147,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Hackers hackers_entry
|
||||
)
|
||||
{
|
||||
@@ -190,7 +161,7 @@ public:
|
||||
update_values.push_back(columns[4] + " = '" + EscapeString(hackers_entry.zone) + "'");
|
||||
update_values.push_back(columns[5] + " = '" + EscapeString(hackers_entry.date) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -204,18 +175,20 @@ public:
|
||||
}
|
||||
|
||||
static Hackers InsertOne(
|
||||
Database& db,
|
||||
Hackers hackers_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(hackers_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(hackers_entry.account) + "'");
|
||||
insert_values.push_back("'" + EscapeString(hackers_entry.name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(hackers_entry.hacked) + "'");
|
||||
insert_values.push_back("'" + EscapeString(hackers_entry.zone) + "'");
|
||||
insert_values.push_back("'" + EscapeString(hackers_entry.date) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -234,6 +207,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Hackers> hackers_entries
|
||||
)
|
||||
{
|
||||
@@ -242,6 +216,7 @@ public:
|
||||
for (auto &hackers_entry: hackers_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(hackers_entry.id));
|
||||
insert_values.push_back("'" + EscapeString(hackers_entry.account) + "'");
|
||||
insert_values.push_back("'" + EscapeString(hackers_entry.name) + "'");
|
||||
insert_values.push_back("'" + EscapeString(hackers_entry.hacked) + "'");
|
||||
@@ -253,7 +228,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -264,11 +239,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Hackers> All()
|
||||
static std::vector<Hackers> All(Database& db)
|
||||
{
|
||||
std::vector<Hackers> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -293,11 +268,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Hackers> GetWhere(std::string where_filter)
|
||||
static std::vector<Hackers> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Hackers> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -323,9 +298,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(),
|
||||
@@ -336,9 +311,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()
|
||||
|
||||
@@ -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_INSTANCE_LIST_PLAYER_REPOSITORY_H
|
||||
@@ -57,21 +40,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("instance_list_player");
|
||||
@@ -91,7 +59,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -120,10 +88,11 @@ public:
|
||||
}
|
||||
|
||||
static InstanceListPlayer FindOne(
|
||||
Database& db,
|
||||
int instance_list_player_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -145,10 +114,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int instance_list_player_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -161,6 +131,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
InstanceListPlayer instance_list_player_entry
|
||||
)
|
||||
{
|
||||
@@ -171,7 +142,7 @@ public:
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(instance_list_player_entry.id));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(instance_list_player_entry.charid));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +156,7 @@ public:
|
||||
}
|
||||
|
||||
static InstanceListPlayer InsertOne(
|
||||
Database& db,
|
||||
InstanceListPlayer instance_list_player_entry
|
||||
)
|
||||
{
|
||||
@@ -193,7 +165,7 @@ public:
|
||||
insert_values.push_back(std::to_string(instance_list_player_entry.id));
|
||||
insert_values.push_back(std::to_string(instance_list_player_entry.charid));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -212,6 +184,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<InstanceListPlayer> instance_list_player_entries
|
||||
)
|
||||
{
|
||||
@@ -228,7 +201,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -239,11 +212,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<InstanceListPlayer> All()
|
||||
static std::vector<InstanceListPlayer> All(Database& db)
|
||||
{
|
||||
std::vector<InstanceListPlayer> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -264,11 +237,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<InstanceListPlayer> GetWhere(std::string where_filter)
|
||||
static std::vector<InstanceListPlayer> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<InstanceListPlayer> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -290,9 +263,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(),
|
||||
@@ -303,9 +276,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()
|
||||
|
||||
@@ -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_INSTANCE_LIST_REPOSITORY_H
|
||||
@@ -67,21 +50,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("instance_list");
|
||||
@@ -101,7 +69,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -135,10 +103,11 @@ public:
|
||||
}
|
||||
|
||||
static InstanceList FindOne(
|
||||
Database& db,
|
||||
int instance_list_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -165,10 +134,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int instance_list_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -181,6 +151,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
InstanceList instance_list_entry
|
||||
)
|
||||
{
|
||||
@@ -195,7 +166,7 @@ public:
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(instance_list_entry.duration));
|
||||
update_values.push_back(columns[6] + " = " + std::to_string(instance_list_entry.never_expires));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -209,11 +180,13 @@ public:
|
||||
}
|
||||
|
||||
static InstanceList InsertOne(
|
||||
Database& db,
|
||||
InstanceList instance_list_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(instance_list_entry.id));
|
||||
insert_values.push_back(std::to_string(instance_list_entry.zone));
|
||||
insert_values.push_back(std::to_string(instance_list_entry.version));
|
||||
insert_values.push_back(std::to_string(instance_list_entry.is_global));
|
||||
@@ -221,7 +194,7 @@ public:
|
||||
insert_values.push_back(std::to_string(instance_list_entry.duration));
|
||||
insert_values.push_back(std::to_string(instance_list_entry.never_expires));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -240,6 +213,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<InstanceList> instance_list_entries
|
||||
)
|
||||
{
|
||||
@@ -248,6 +222,7 @@ public:
|
||||
for (auto &instance_list_entry: instance_list_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(instance_list_entry.id));
|
||||
insert_values.push_back(std::to_string(instance_list_entry.zone));
|
||||
insert_values.push_back(std::to_string(instance_list_entry.version));
|
||||
insert_values.push_back(std::to_string(instance_list_entry.is_global));
|
||||
@@ -260,7 +235,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -271,11 +246,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<InstanceList> All()
|
||||
static std::vector<InstanceList> All(Database& db)
|
||||
{
|
||||
std::vector<InstanceList> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -301,11 +276,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<InstanceList> GetWhere(std::string where_filter)
|
||||
static std::vector<InstanceList> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<InstanceList> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -332,9 +307,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(),
|
||||
@@ -345,9 +320,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()
|
||||
|
||||
@@ -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_INVENTORY_REPOSITORY_H
|
||||
@@ -85,21 +68,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("inventory");
|
||||
@@ -119,7 +87,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -162,10 +130,11 @@ public:
|
||||
}
|
||||
|
||||
static Inventory FindOne(
|
||||
Database& db,
|
||||
int inventory_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -201,10 +170,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int inventory_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -217,6 +187,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Inventory inventory_entry
|
||||
)
|
||||
{
|
||||
@@ -241,7 +212,7 @@ public:
|
||||
update_values.push_back(columns[14] + " = " + std::to_string(inventory_entry.ornamentidfile));
|
||||
update_values.push_back(columns[15] + " = " + std::to_string(inventory_entry.ornament_hero_model));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -255,6 +226,7 @@ public:
|
||||
}
|
||||
|
||||
static Inventory InsertOne(
|
||||
Database& db,
|
||||
Inventory inventory_entry
|
||||
)
|
||||
{
|
||||
@@ -277,7 +249,7 @@ public:
|
||||
insert_values.push_back(std::to_string(inventory_entry.ornamentidfile));
|
||||
insert_values.push_back(std::to_string(inventory_entry.ornament_hero_model));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -296,6 +268,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Inventory> inventory_entries
|
||||
)
|
||||
{
|
||||
@@ -326,7 +299,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -337,11 +310,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Inventory> All()
|
||||
static std::vector<Inventory> All(Database& db)
|
||||
{
|
||||
std::vector<Inventory> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -376,11 +349,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Inventory> GetWhere(std::string where_filter)
|
||||
static std::vector<Inventory> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Inventory> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -416,9 +389,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(),
|
||||
@@ -429,9 +402,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()
|
||||
|
||||
@@ -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_INVENTORY_SNAPSHOTS_REPOSITORY_H
|
||||
@@ -87,21 +70,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("inventory_snapshots");
|
||||
@@ -121,7 +89,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -165,10 +133,11 @@ public:
|
||||
}
|
||||
|
||||
static InventorySnapshots FindOne(
|
||||
Database& db,
|
||||
int inventory_snapshots_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -205,10 +174,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int inventory_snapshots_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -221,6 +191,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
InventorySnapshots inventory_snapshots_entry
|
||||
)
|
||||
{
|
||||
@@ -246,7 +217,7 @@ public:
|
||||
update_values.push_back(columns[15] + " = " + std::to_string(inventory_snapshots_entry.ornamentidfile));
|
||||
update_values.push_back(columns[16] + " = " + std::to_string(inventory_snapshots_entry.ornament_hero_model));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -260,6 +231,7 @@ public:
|
||||
}
|
||||
|
||||
static InventorySnapshots InsertOne(
|
||||
Database& db,
|
||||
InventorySnapshots inventory_snapshots_entry
|
||||
)
|
||||
{
|
||||
@@ -283,7 +255,7 @@ public:
|
||||
insert_values.push_back(std::to_string(inventory_snapshots_entry.ornamentidfile));
|
||||
insert_values.push_back(std::to_string(inventory_snapshots_entry.ornament_hero_model));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -302,6 +274,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<InventorySnapshots> inventory_snapshots_entries
|
||||
)
|
||||
{
|
||||
@@ -333,7 +306,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -344,11 +317,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<InventorySnapshots> All()
|
||||
static std::vector<InventorySnapshots> All(Database& db)
|
||||
{
|
||||
std::vector<InventorySnapshots> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -384,11 +357,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<InventorySnapshots> GetWhere(std::string where_filter)
|
||||
static std::vector<InventorySnapshots> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<InventorySnapshots> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -425,9 +398,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(),
|
||||
@@ -438,9 +411,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()
|
||||
|
||||
@@ -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_IP_EXEMPTIONS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("ip_exemptions");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static IpExemptions FindOne(
|
||||
Database& db,
|
||||
int ip_exemptions_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int ip_exemptions_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
IpExemptions ip_exemptions_entry
|
||||
)
|
||||
{
|
||||
@@ -175,7 +146,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = '" + EscapeString(ip_exemptions_entry.exemption_ip) + "'");
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(ip_exemptions_entry.exemption_amount));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,15 +160,17 @@ public:
|
||||
}
|
||||
|
||||
static IpExemptions InsertOne(
|
||||
Database& db,
|
||||
IpExemptions ip_exemptions_entry
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(ip_exemptions_entry.exemption_id));
|
||||
insert_values.push_back("'" + EscapeString(ip_exemptions_entry.exemption_ip) + "'");
|
||||
insert_values.push_back(std::to_string(ip_exemptions_entry.exemption_amount));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -216,6 +189,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<IpExemptions> ip_exemptions_entries
|
||||
)
|
||||
{
|
||||
@@ -224,6 +198,7 @@ public:
|
||||
for (auto &ip_exemptions_entry: ip_exemptions_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(ip_exemptions_entry.exemption_id));
|
||||
insert_values.push_back("'" + EscapeString(ip_exemptions_entry.exemption_ip) + "'");
|
||||
insert_values.push_back(std::to_string(ip_exemptions_entry.exemption_amount));
|
||||
|
||||
@@ -232,7 +207,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -243,11 +218,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<IpExemptions> All()
|
||||
static std::vector<IpExemptions> All(Database& db)
|
||||
{
|
||||
std::vector<IpExemptions> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -269,11 +244,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<IpExemptions> GetWhere(std::string where_filter)
|
||||
static std::vector<IpExemptions> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<IpExemptions> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -296,9 +271,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(),
|
||||
@@ -309,9 +284,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()
|
||||
|
||||
@@ -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_ITEM_TICK_REPOSITORY_H
|
||||
@@ -65,21 +48,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("item_tick");
|
||||
@@ -99,7 +67,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,10 +100,11 @@ public:
|
||||
}
|
||||
|
||||
static ItemTick FindOne(
|
||||
Database& db,
|
||||
int item_tick_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -161,10 +130,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int item_tick_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -177,6 +147,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
ItemTick item_tick_entry
|
||||
)
|
||||
{
|
||||
@@ -190,7 +161,7 @@ public:
|
||||
update_values.push_back(columns[4] + " = '" + EscapeString(item_tick_entry.it_qglobal) + "'");
|
||||
update_values.push_back(columns[5] + " = " + std::to_string(item_tick_entry.it_bagslot));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -204,6 +175,7 @@ public:
|
||||
}
|
||||
|
||||
static ItemTick InsertOne(
|
||||
Database& db,
|
||||
ItemTick item_tick_entry
|
||||
)
|
||||
{
|
||||
@@ -212,10 +184,11 @@ public:
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_itemid));
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_chance));
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_level));
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_id));
|
||||
insert_values.push_back("'" + EscapeString(item_tick_entry.it_qglobal) + "'");
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_bagslot));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -234,6 +207,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<ItemTick> item_tick_entries
|
||||
)
|
||||
{
|
||||
@@ -245,6 +219,7 @@ public:
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_itemid));
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_chance));
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_level));
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_id));
|
||||
insert_values.push_back("'" + EscapeString(item_tick_entry.it_qglobal) + "'");
|
||||
insert_values.push_back(std::to_string(item_tick_entry.it_bagslot));
|
||||
|
||||
@@ -253,7 +228,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -264,11 +239,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<ItemTick> All()
|
||||
static std::vector<ItemTick> All(Database& db)
|
||||
{
|
||||
std::vector<ItemTick> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -293,11 +268,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<ItemTick> GetWhere(std::string where_filter)
|
||||
static std::vector<ItemTick> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<ItemTick> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -323,9 +298,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(),
|
||||
@@ -336,9 +311,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()
|
||||
|
||||
@@ -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_ITEMS_REPOSITORY_H
|
||||
@@ -623,21 +606,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("items");
|
||||
@@ -657,7 +625,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -969,10 +937,11 @@ public:
|
||||
}
|
||||
|
||||
static Items FindOne(
|
||||
Database& db,
|
||||
int items_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -1277,10 +1246,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int items_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -1293,6 +1263,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Items items_entry
|
||||
)
|
||||
{
|
||||
@@ -1586,7 +1557,7 @@ public:
|
||||
update_values.push_back(columns[283] + " = " + std::to_string(items_entry.UNK241));
|
||||
update_values.push_back(columns[284] + " = " + std::to_string(items_entry.epicitem));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -1600,6 +1571,7 @@ public:
|
||||
}
|
||||
|
||||
static Items InsertOne(
|
||||
Database& db,
|
||||
Items items_entry
|
||||
)
|
||||
{
|
||||
@@ -1891,7 +1863,7 @@ public:
|
||||
insert_values.push_back(std::to_string(items_entry.UNK241));
|
||||
insert_values.push_back(std::to_string(items_entry.epicitem));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -1910,6 +1882,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Items> items_entries
|
||||
)
|
||||
{
|
||||
@@ -2209,7 +2182,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -2220,11 +2193,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Items> All()
|
||||
static std::vector<Items> All(Database& db)
|
||||
{
|
||||
std::vector<Items> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -2528,11 +2501,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Items> GetWhere(std::string where_filter)
|
||||
static std::vector<Items> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Items> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -2837,9 +2810,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -2850,9 +2823,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_LDON_TRAP_ENTRIES_REPOSITORY_H
|
||||
@@ -57,21 +40,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("ldon_trap_entries");
|
||||
@@ -91,7 +59,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -120,10 +88,11 @@ public:
|
||||
}
|
||||
|
||||
static LdonTrapEntries FindOne(
|
||||
Database& db,
|
||||
int ldon_trap_entries_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -145,10 +114,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int ldon_trap_entries_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -161,6 +131,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
LdonTrapEntries ldon_trap_entries_entry
|
||||
)
|
||||
{
|
||||
@@ -171,7 +142,7 @@ public:
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(ldon_trap_entries_entry.id));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(ldon_trap_entries_entry.trap_id));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -185,6 +156,7 @@ public:
|
||||
}
|
||||
|
||||
static LdonTrapEntries InsertOne(
|
||||
Database& db,
|
||||
LdonTrapEntries ldon_trap_entries_entry
|
||||
)
|
||||
{
|
||||
@@ -193,7 +165,7 @@ public:
|
||||
insert_values.push_back(std::to_string(ldon_trap_entries_entry.id));
|
||||
insert_values.push_back(std::to_string(ldon_trap_entries_entry.trap_id));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -212,6 +184,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<LdonTrapEntries> ldon_trap_entries_entries
|
||||
)
|
||||
{
|
||||
@@ -228,7 +201,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -239,11 +212,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<LdonTrapEntries> All()
|
||||
static std::vector<LdonTrapEntries> All(Database& db)
|
||||
{
|
||||
std::vector<LdonTrapEntries> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -264,11 +237,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<LdonTrapEntries> GetWhere(std::string where_filter)
|
||||
static std::vector<LdonTrapEntries> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<LdonTrapEntries> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -290,9 +263,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -303,9 +276,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_LDON_TRAP_TEMPLATES_REPOSITORY_H
|
||||
@@ -63,21 +46,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("ldon_trap_templates");
|
||||
@@ -97,7 +65,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,10 +97,11 @@ public:
|
||||
}
|
||||
|
||||
static LdonTrapTemplates FindOne(
|
||||
Database& db,
|
||||
int ldon_trap_templates_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -157,10 +126,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int ldon_trap_templates_id
|
||||
)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -173,6 +143,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
LdonTrapTemplates ldon_trap_templates_entry
|
||||
)
|
||||
{
|
||||
@@ -186,7 +157,7 @@ public:
|
||||
update_values.push_back(columns[3] + " = " + std::to_string(ldon_trap_templates_entry.skill));
|
||||
update_values.push_back(columns[4] + " = " + std::to_string(ldon_trap_templates_entry.locked));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -200,6 +171,7 @@ public:
|
||||
}
|
||||
|
||||
static LdonTrapTemplates InsertOne(
|
||||
Database& db,
|
||||
LdonTrapTemplates ldon_trap_templates_entry
|
||||
)
|
||||
{
|
||||
@@ -211,7 +183,7 @@ public:
|
||||
insert_values.push_back(std::to_string(ldon_trap_templates_entry.skill));
|
||||
insert_values.push_back(std::to_string(ldon_trap_templates_entry.locked));
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -230,6 +202,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<LdonTrapTemplates> ldon_trap_templates_entries
|
||||
)
|
||||
{
|
||||
@@ -249,7 +222,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -260,11 +233,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<LdonTrapTemplates> All()
|
||||
static std::vector<LdonTrapTemplates> All(Database& db)
|
||||
{
|
||||
std::vector<LdonTrapTemplates> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -288,11 +261,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<LdonTrapTemplates> GetWhere(std::string where_filter)
|
||||
static std::vector<LdonTrapTemplates> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<LdonTrapTemplates> all_entries;
|
||||
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -317,9 +290,9 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(std::string where_filter)
|
||||
static int DeleteWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
@@ -330,9 +303,9 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate()
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = content_db.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
|
||||
@@ -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_LEVEL_EXP_MODS_REPOSITORY_H
|
||||
@@ -59,21 +42,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("level_exp_mods");
|
||||
@@ -93,7 +61,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,10 +91,11 @@ public:
|
||||
}
|
||||
|
||||
static LevelExpMods FindOne(
|
||||
Database& db,
|
||||
int level_exp_mods_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -149,10 +118,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int level_exp_mods_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -165,6 +135,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
LevelExpMods level_exp_mods_entry
|
||||
)
|
||||
{
|
||||
@@ -176,7 +147,7 @@ public:
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(level_exp_mods_entry.exp_mod));
|
||||
update_values.push_back(columns[2] + " = " + std::to_string(level_exp_mods_entry.aa_exp_mod));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -190,6 +161,7 @@ public:
|
||||
}
|
||||
|
||||
static LevelExpMods InsertOne(
|
||||
Database& db,
|
||||
LevelExpMods level_exp_mods_entry
|
||||
)
|
||||
{
|
||||
@@ -199,7 +171,7 @@ public:
|
||||
insert_values.push_back(std::to_string(level_exp_mods_entry.exp_mod));
|
||||
insert_values.push_back(std::to_string(level_exp_mods_entry.aa_exp_mod));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -218,6 +190,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<LevelExpMods> level_exp_mods_entries
|
||||
)
|
||||
{
|
||||
@@ -235,7 +208,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -246,11 +219,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<LevelExpMods> All()
|
||||
static std::vector<LevelExpMods> All(Database& db)
|
||||
{
|
||||
std::vector<LevelExpMods> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -272,11 +245,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<LevelExpMods> GetWhere(std::string where_filter)
|
||||
static std::vector<LevelExpMods> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<LevelExpMods> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -299,9 +272,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(),
|
||||
@@ -312,9 +285,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()
|
||||
|
||||
@@ -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_LFGUILD_REPOSITORY_H
|
||||
@@ -71,21 +54,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("lfguild");
|
||||
@@ -105,7 +73,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,10 +109,11 @@ public:
|
||||
}
|
||||
|
||||
static Lfguild FindOne(
|
||||
Database& db,
|
||||
int lfguild_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -173,10 +142,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int lfguild_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,6 +159,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
Lfguild lfguild_entry
|
||||
)
|
||||
{
|
||||
@@ -206,7 +177,7 @@ public:
|
||||
update_values.push_back(columns[7] + " = " + std::to_string(lfguild_entry.timezone));
|
||||
update_values.push_back(columns[8] + " = " + std::to_string(lfguild_entry.timeposted));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -220,6 +191,7 @@ public:
|
||||
}
|
||||
|
||||
static Lfguild InsertOne(
|
||||
Database& db,
|
||||
Lfguild lfguild_entry
|
||||
)
|
||||
{
|
||||
@@ -235,7 +207,7 @@ public:
|
||||
insert_values.push_back(std::to_string(lfguild_entry.timezone));
|
||||
insert_values.push_back(std::to_string(lfguild_entry.timeposted));
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -254,6 +226,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<Lfguild> lfguild_entries
|
||||
)
|
||||
{
|
||||
@@ -277,7 +250,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -288,11 +261,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<Lfguild> All()
|
||||
static std::vector<Lfguild> All(Database& db)
|
||||
{
|
||||
std::vector<Lfguild> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -320,11 +293,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<Lfguild> GetWhere(std::string where_filter)
|
||||
static std::vector<Lfguild> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<Lfguild> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -353,9 +326,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(),
|
||||
@@ -366,9 +339,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()
|
||||
|
||||
@@ -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_LOGIN_ACCOUNTS_REPOSITORY_H
|
||||
@@ -71,21 +54,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("login_accounts");
|
||||
@@ -105,7 +73,7 @@ public:
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
InsertColumnsRaw()
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,10 +109,11 @@ public:
|
||||
}
|
||||
|
||||
static LoginAccounts FindOne(
|
||||
Database& db,
|
||||
int login_accounts_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
@@ -173,10 +142,11 @@ public:
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int login_accounts_id
|
||||
)
|
||||
{
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -189,6 +159,7 @@ public:
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
LoginAccounts login_accounts_entry
|
||||
)
|
||||
{
|
||||
@@ -206,7 +177,7 @@ public:
|
||||
update_values.push_back(columns[7] + " = '" + EscapeString(login_accounts_entry.created_at) + "'");
|
||||
update_values.push_back(columns[8] + " = '" + EscapeString(login_accounts_entry.updated_at) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
@@ -220,6 +191,7 @@ public:
|
||||
}
|
||||
|
||||
static LoginAccounts InsertOne(
|
||||
Database& db,
|
||||
LoginAccounts login_accounts_entry
|
||||
)
|
||||
{
|
||||
@@ -235,7 +207,7 @@ public:
|
||||
insert_values.push_back("'" + EscapeString(login_accounts_entry.created_at) + "'");
|
||||
insert_values.push_back("'" + EscapeString(login_accounts_entry.updated_at) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
@@ -254,6 +226,7 @@ public:
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
std::vector<LoginAccounts> login_accounts_entries
|
||||
)
|
||||
{
|
||||
@@ -277,7 +250,7 @@ public:
|
||||
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
@@ -288,11 +261,11 @@ public:
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<LoginAccounts> All()
|
||||
static std::vector<LoginAccounts> All(Database& db)
|
||||
{
|
||||
std::vector<LoginAccounts> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
@@ -320,11 +293,11 @@ public:
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<LoginAccounts> GetWhere(std::string where_filter)
|
||||
static std::vector<LoginAccounts> GetWhere(Database& db, std::string where_filter)
|
||||
{
|
||||
std::vector<LoginAccounts> all_entries;
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
@@ -353,9 +326,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(),
|
||||
@@ -366,9 +339,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()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user