1 #include "otsdaq/ConfigurationInterface/Database_configInterface.h"
2 #include "otsdaq/Macros/ConfigurationInterfacePluginMacros.h"
3 #include "otsdaq/Macros/CoutMacros.h"
4 #include "otsdaq/MessageFacility/MessageFacility.h"
11 #include "artdaq-database/BasicTypes/basictypes.h"
12 #include "artdaq-database/ConfigurationDB/configurationdbifc.h"
13 #include "otsdaq/TableCore/TableBase.h"
15 #include "artdaq-database/ConfigurationDB/configuration_common.h"
16 #include "artdaq-database/ConfigurationDB/dispatch_common.h"
17 #include "artdaq-database/StorageProviders/FileSystemDB/provider_filedb.h"
18 #include "artdaq-database/StorageProviders/FileSystemDB/provider_filedb_index.h"
24 #define TRACE_NAME __MF_DECOR__
28 using artdaq::database::basictypes::FhiclData;
29 using artdaq::database::basictypes::JsonData;
32 using table_version_map_t = ots::DatabaseConfigurationInterface::table_version_map_t;
34 namespace db = artdaq::database::configuration;
35 using VersionInfoList_t = db::ConfigurationInterface::VersionInfoList_t;
37 constexpr
auto default_dbprovider =
"filesystem";
38 constexpr
auto default_entity =
"OTSROOT";
41 DatabaseConfigurationInterface::DatabaseConfigurationInterface()
43 #ifdef ARTDAQ_DATABASE_DEBUG_ENABLE
46 artdaq::database::configuration::debug::ExportImport();
47 artdaq::database::configuration::debug::ManageAliases();
48 artdaq::database::configuration::debug::ManageConfigs();
49 artdaq::database::configuration::debug::ManageDocuments();
50 artdaq::database::configuration::debug::Metadata();
52 artdaq::database::configuration::debug::detail::ExportImport();
53 artdaq::database::configuration::debug::detail::ManageAliases();
54 artdaq::database::configuration::debug::detail::ManageConfigs();
55 artdaq::database::configuration::debug::detail::ManageDocuments();
56 artdaq::database::configuration::debug::detail::Metadata();
58 artdaq::database::configuration::debug::options::OperationBase();
59 artdaq::database::configuration::debug::options::BulkOperations();
60 artdaq::database::configuration::debug::options::ManageDocuments();
61 artdaq::database::configuration::debug::options::ManageConfigs();
62 artdaq::database::configuration::debug::options::ManageAliases();
64 artdaq::database::configuration::debug::MongoDB();
65 artdaq::database::configuration::debug::UconDB();
66 artdaq::database::configuration::debug::FileSystemDB();
68 artdaq::database::filesystem::index::debug::enable();
71 artdaq::database::filesystem::debug::enable();
80 artdaq::database::configuration::Multitasker();
81 TRACE_CNTL(
"modeS",
true);
85 std::string envVar = __ENV__(
"ARTDAQ_DATABASE_URI");
88 IS_FILESYSTEM_DB =
false;
90 IS_FILESYSTEM_DB =
true;
91 __COUTV__(IS_FILESYSTEM_DB);
99 auto start = std::chrono::high_resolution_clock::now();
101 auto ifc = db::ConfigurationInterface{default_dbprovider};
103 auto versionstring = version.
toString();
105 auto result = ifc.template loadVersion<decltype(table), JsonData>(
106 table, versionstring, default_entity);
108 auto end = std::chrono::high_resolution_clock::now();
110 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
111 __COUTT__ <<
"Time taken to call DatabaseConfigurationInterface::fill(tableName="
112 << table->
getTableName() <<
", version=" << versionstring <<
") "
113 << duration <<
" milliseconds." << std::endl;
121 if(result.second.find(
"failed to create a client session") != std::string::npos ||
122 result.second.find(
"closed connection. calling hello") != std::string::npos)
124 __SS__ <<
"\n\n======> Database Interface Error while filling '"
125 << table->
getTableName() <<
"' version '" << versionstring
126 <<
"' - it appears that the connection to the database been lost. Please "
127 "check the database server and route to server.\n\n"
128 <<
"Here is the error detail:\n\n"
129 << result.second << __E__;
133 __SS__ <<
"\n\n======> Database Interface Error while filling '"
134 << table->
getTableName() <<
"' version '" << versionstring
135 <<
"' - are you sure this version exists? Or has the connection to the "
136 "database been lost?\n\n"
137 <<
"Here is the error detail:\n\n"
138 << result.second << __E__;
145 bool overwrite)
const
147 auto start = std::chrono::high_resolution_clock::now();
149 auto ifc = db::ConfigurationInterface{default_dbprovider};
151 auto versionstring = table->getView().getVersion().
toString();
152 std::stringstream preSaveJSONss;
153 table->getView().printJSON(preSaveJSONss);
159 auto result = overwrite ? ifc.template overwriteVersion<decltype(table), JsonData>(
160 table, versionstring, default_entity)
161 : ifc.template storeVersion<decltype(table), JsonData>(
162 table, versionstring, default_entity);
164 auto end = std::chrono::high_resolution_clock::now();
166 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
167 __COUTT__ <<
"Time taken to call "
168 "DatabaseConfigurationInterface::saveActiveVersion(tableName="
169 << table->
getTableName() <<
", versionstring=" << versionstring <<
") "
170 << duration <<
" milliseconds" << std::endl;
172 __COUTTV__(result.first);
173 __COUTVS__(10, result.second);
181 localDocLoader.changeVersionAndActivateView(
183 fill(&localDocLoader, table->getView().getVersion());
185 std::stringstream postSaveJSONss;
186 localDocLoader.getView().printJSON(postSaveJSONss);
188 __COUTVS__(2, preSaveJSONss.str());
189 __COUTVS__(2, postSaveJSONss.str());
193 auto preSaveJSON = preSaveJSONss.str();
194 auto postSaveJSON = postSaveJSONss.str();
195 size_t prec = 0, postc = 0;
196 for(; prec < preSaveJSON.size() && postc < postSaveJSON.size();
199 if(preSaveJSON[prec] ==
'\n' || preSaveJSON[prec] ==
'\t' ||
200 preSaveJSON[prec] ==
' ')
206 else if(postSaveJSON[postc] ==
'\n' || postSaveJSON[postc] ==
'\t' ||
207 postSaveJSON[postc] ==
' ')
213 if(preSaveJSON[prec] != postSaveJSON[postc])
215 __COUTT__ <<
"Mismatch at preSaveJSON[" << prec
216 <<
"] != postSaveJSON[" << postc <<
"] ... "
217 << preSaveJSON.substr(prec, 30)
218 <<
" != " << postSaveJSON.substr(postc, 30) << __E__;
231 __COUT__ <<
"NOT Same";
232 auto end = std::chrono::high_resolution_clock::now();
234 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
237 <<
"Time taken to call "
238 "DatabaseConfigurationInterface::saveActiveVersion(tableName="
239 << table->
getTableName() <<
", versionstring=" << versionstring
240 <<
") " << duration <<
" milliseconds" << std::endl;
242 __SS__ <<
"Error saving table '" << table->
getTableName() <<
"'-v"
244 <<
" (perhaps there was a collision with another user saving the "
245 "same table name/version?! Please try again with an "
246 "incremented table version). "
247 <<
"Expected data size is " << preSaveJSONss.str().size()
248 <<
" and readback found size of " << postSaveJSONss.str().size()
249 <<
" with character mismatches." << __E__;
253 auto end = std::chrono::high_resolution_clock::now();
255 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
257 __COUTT__ <<
"Time taken to call "
258 "DatabaseConfigurationInterface::saveActiveVersion(tableName="
259 << table->
getTableName() <<
", versionstring=" << versionstring
260 <<
") " << duration <<
" milliseconds" << std::endl;
266 __SS__ <<
"Database Interface saveActiveVersion Error:" << result.second << __E__;
275 auto versions = getVersions(table);
279 __COUTT__ <<
"Table Name: " << table->getTableName() << __E__;
280 __SS__ <<
"All Versions: ";
281 for(
auto& v : versions)
284 __COUTT__ <<
"\n" << ss.str();
290 return *(versions.rbegin());
299 auto start = std::chrono::high_resolution_clock::now();
301 auto ifc = db::ConfigurationInterface{default_dbprovider};
302 auto result = ifc.template getVersions<decltype(table)>(table, default_entity);
304 auto end = std::chrono::high_resolution_clock::now();
306 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
308 <<
"Time taken to call DatabaseConfigurationInterface::getVersions(tableName="
309 << table->getTableName() <<
") " << duration <<
" milliseconds." << std::endl;
311 auto resultSet = std::set<TableVersion>{};
312 for(std::string
const& version : result)
313 resultSet.insert(
TableVersion(std::stol(version, 0, 10)));
319 catch(std::exception
const& e)
321 __COUT_WARN__ <<
"Database Interface Exception:" << e.what() <<
"\n";
330 auto start = std::chrono::high_resolution_clock::now();
332 auto ifc = db::ConfigurationInterface{default_dbprovider};
333 auto collection_name_prefix = std::string{};
335 auto result = ifc.listCollections(collection_name_prefix);
337 auto end = std::chrono::high_resolution_clock::now();
339 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
341 <<
"Time taken to call "
342 "DatabaseConfigurationInterface::getAllTableNames(collection_name_prefix="
343 << collection_name_prefix <<
") " << duration <<
" milliseconds." << std::endl;
347 catch(std::exception
const& e)
349 __SS__ <<
"Database Interface Exception:" << e.what() <<
"\n";
354 __SS__ <<
"Database Interface Unknown exception.\n";
361 std::string
const& filterString)
const
364 auto start = std::chrono::high_resolution_clock::now();
366 auto ifc = db::ConfigurationInterface{default_dbprovider};
368 auto result = std::set<std::string>();
370 if(filterString ==
"")
371 result = ifc.findGlobalConfigurations(
"*");
375 result = ifc.findGlobalConfigurations(filterString +
"*");
380 auto end = std::chrono::high_resolution_clock::now();
382 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
383 __COUTT__ <<
"Time taken to call "
384 "DatabaseConfigurationInterface::getAllTableGroupNames(filterString="
385 << filterString <<
") " << duration <<
" milliseconds." << std::endl;
389 catch(std::exception
const& e)
391 __SS__ <<
"Filter string '" << filterString
392 <<
"' yielded Database Interface Exception:" << e.what() <<
"\n";
397 __SS__ <<
"Filter string '" << filterString
398 <<
"' yielded Database Interface Unknown exception.\n";
406 const std::string& groupName)
const noexcept
414 TableBase::GROUP_CACHE_PREPEND + groupName);
416 findLatestVersion(&localGroupMemberCacheLoader);
417 __COUTTV__(lastestGroupCacheKey);
423 __COUT__ <<
"Ignoring cache loading error." << __E__;
428 return *(keys.crbegin());
437 const std::string& groupName)
const
439 std::set<TableGroupKey> retSet;
442 if(n.find(groupName) == 0)
450 std::string
const& tableGroup,
bool includeMetaDataTable )
const
453 auto start = std::chrono::high_resolution_clock::now();
468 table_version_map_t retMap = getCachedTableGroupMembers(tableGroup);
469 __COUTV__(tableGroup);
472 if(!includeMetaDataTable)
475 auto metaTable = retMap.find(TableBase::GROUP_METADATA_TABLE_NAME);
476 if(metaTable != retMap.end())
477 retMap.erase(metaTable);
480 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
481 std::chrono::high_resolution_clock::now() - start)
483 __COUTT__ <<
"Time taken to call "
484 "DatabaseConfigurationInterface::getTableGroupMembers(tableGroup="
485 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
490 __COUTT__ <<
"Ignoring error "
491 "DatabaseConfigurationInterface::getTableGroupMembers(tableGroup="
492 << tableGroup <<
") " << __E__;
495 auto ifc = db::ConfigurationInterface{default_dbprovider};
496 auto result = ifc.loadGlobalConfiguration(tableGroup);
500 for(
auto& item : result)
501 __COUTT__ <<
"====================> " << item.configuration <<
": "
502 << item.version << __E__;
505 auto to_map = [](
auto const& inputList,
bool includeMetaDataTable) {
506 auto resultMap = table_version_map_t{};
508 std::for_each(inputList.begin(), inputList.end(), [&resultMap](
auto const& info) {
509 resultMap[info.configuration] = std::stol(info.version, 0, 10);
512 if(!includeMetaDataTable)
515 auto metaTable = resultMap.find(TableBase::GROUP_METADATA_TABLE_NAME);
516 if(metaTable != resultMap.end())
517 resultMap.erase(metaTable);
522 table_version_map_t retMap = to_map(result, includeMetaDataTable);
525 saveTableGroupMemberCache(retMap, tableGroup);
530 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
531 std::chrono::high_resolution_clock::now() - start)
533 __COUTT__ <<
"Time taken to call "
534 "DatabaseConfigurationInterface::getTableGroupMembers(tableGroup="
535 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
539 catch(std::exception
const& e)
541 __SS__ <<
"Database Interface Exception getting Group's member tables for '"
542 << tableGroup <<
"':\n\n"
544 if(std::string(e.what()).find(
"connection refused") != std::string::npos)
546 ss <<
"\n\nConnection to database refused. Perhaps your ssh tunnel has "
553 __SS__ <<
"Database Interface Unknown exception getting Group's member tables for '"
554 << tableGroup <<
".'\n";
555 __COUT_ERR__ << ss.str();
562 table_version_map_t DatabaseConfigurationInterface::getCachedTableGroupMembers(
563 std::string
const& tableGroup)
const
566 table_version_map_t retMap;
580 std::size_t vi = tableGroup.rfind(
"_v");
581 std::string groupName = tableGroup.substr(0, vi);
582 std::string groupKey = tableGroup.substr(vi + 2);
583 __COUTT__ <<
"Getting cache for " << groupName <<
"(" << groupKey <<
")" << __E__;
588 TableBase::GROUP_CACHE_PREPEND + groupName);
594 __COUTT__ <<
"IS_FILESYSTEM_DB=true, so checking cached keys for " << groupName
595 <<
"(" << groupKey <<
")" << __E__;
596 std::set<TableVersion> versions = getVersions(&localGroupMemberCacheSaver);
597 if(versions.find(localVersion) == versions.end())
599 __SS__ <<
"Cached member table versions not found for " << groupName <<
"("
600 << groupKey <<
")" << __E__;
605 localGroupMemberCacheSaver.changeVersionAndActivateView(
606 localGroupMemberCacheSaver.createTemporaryView(), localVersion);
608 fill(&localGroupMemberCacheSaver, localVersion);
610 __COUTS__(20) <<
"Loaded cache member map string "
611 << localGroupMemberCacheSaver.getViewP()->getCustomStorageData()
616 std::string jsonClean =
"";
617 const std::string& json =
618 localGroupMemberCacheSaver.getViewP()->getCustomStorageData();
620 if(c ==
'{' || c ==
'}' || c ==
'"' || c ==
' ')
624 __COUTVS__(21, jsonClean);
628 __COUTS__(20) <<
"Loaded cache member map string "
633 catch(std::exception
const& e)
635 __SS__ <<
"Database Interface Exception getCachedTableGroupMembers for '"
636 << tableGroup <<
"':\n\n"
642 __SS__ <<
"Database Interface Unknown exception getCachedTableGroupMembers for '"
643 << tableGroup <<
".'\n";
649 void DatabaseConfigurationInterface::saveTableGroupMemberCache(
650 table_version_map_t
const& memberMap, std::string
const& tableGroup)
const
665 std::size_t vi = tableGroup.rfind(
"_v");
666 std::string groupName = tableGroup.substr(0, vi);
667 std::string groupKey = tableGroup.substr(vi + 2);
668 __COUTT__ <<
"Saving cache for " << groupName <<
"(" << groupKey <<
")" << __E__;
673 TableBase::GROUP_CACHE_PREPEND + groupName);
674 localGroupMemberCacheSaver.changeVersionAndActivateView(
675 localGroupMemberCacheSaver.createTemporaryView(),
679 std::stringstream groupCacheData;
680 groupCacheData <<
"{ ";
681 for(
const auto& member : memberMap)
682 groupCacheData << (member.first == memberMap.begin()->first ?
"" :
", ")
684 "\"" << member.first <<
"\" : \"" << member.second <<
"\"";
685 groupCacheData <<
"}";
687 localGroupMemberCacheSaver.getViewP()->setCustomStorageData(groupCacheData.str());
690 __COUTT__ <<
"Saving member map string "
691 << localGroupMemberCacheSaver.getViewP()->getCustomStorageData() << __E__;
693 __COUTT__ <<
"Saving cache table "
694 << localGroupMemberCacheSaver.getView().getTableName() <<
"("
695 << localGroupMemberCacheSaver.getView().getVersion().toString() <<
")"
699 saveActiveVersion(&localGroupMemberCacheSaver,
false );
702 catch(std::exception
const& e)
704 __SS__ <<
"Database Interface Exception saveTableGroupMemberCache for '" << tableGroup
707 __COUT_ERR__ << ss.str();
712 __SS__ <<
"Database Interface Unknown exception saveTableGroupMemberCache for '"
713 << tableGroup <<
".'\n";
714 __COUT_ERR__ << ss.str();
721 std::string
const& tableGroup)
const
724 auto start = std::chrono::high_resolution_clock::now();
726 auto ifc = db::ConfigurationInterface{default_dbprovider};
730 auto to_list = [](
auto const& inputMap) {
731 auto resultList = VersionInfoList_t{};
735 std::back_inserter(resultList),
736 [](
auto const& mapEntry) {
737 return VersionInfoList_t::value_type{
738 mapEntry.first, mapEntry.second.toString(), default_entity};
745 auto result = IS_FILESYSTEM_DB
746 ? ifc.storeGlobalConfiguration(to_list(memberMap), tableGroup)
747 : ifc.storeGlobalConfiguration_mt(to_list(memberMap), tableGroup);
749 __COUTTV__(result.first);
750 __COUTVS__(10, result.second);
752 auto end = std::chrono::high_resolution_clock::now();
754 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
756 <<
"Time taken to call DatabaseConfigurationInterface::saveTableGroup(tableGroup="
757 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
762 auto readbackResult = ifc.loadGlobalConfiguration(tableGroup);
765 for(
auto& item : readbackResult)
766 __COUTT__ <<
"--==> " << item.configuration <<
": " << item.version
769 size_t countOfMatches = 0;
770 for(
auto& item : readbackResult)
772 __COUTT__ <<
"====================> " << item.configuration <<
": "
773 << item.version << __E__;
774 const auto& it = memberMap.find(item.configuration);
775 if(it == memberMap.end() ||
776 it->second !=
TableVersion(std::stol(item.version, 0, 10)))
778 auto end = std::chrono::high_resolution_clock::now();
780 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
783 <<
"Time taken to call "
784 "DatabaseConfigurationInterface::saveTableGroup(tableGroup="
785 << tableGroup <<
") " << duration <<
" milliseconds."
787 __SS__ <<
"Error saving group '" << tableGroup
788 <<
"' (perhaps there was a collision with another user saving "
789 "the same group name?! Please try again with an "
790 "incremented group key)). Table '"
791 << item.configuration <<
"'-v" << item.version
792 <<
" was unexpectedly read back as a member table after the "
793 "attempted group save. Expected member tables of group '"
794 << tableGroup <<
"' are as follows:" << __E__;
795 for(
const auto& memberPair : memberMap)
796 ss <<
"\t" << memberPair.first <<
"-v" << memberPair.second
805 if(countOfMatches != memberMap.size())
807 auto end = std::chrono::high_resolution_clock::now();
809 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
811 __COUTT__ <<
"Time taken to call "
812 "DatabaseConfigurationInterface::saveTableGroup(tableGroup="
813 << tableGroup <<
") " << duration <<
" milliseconds."
815 __SS__ <<
"Error saving group '" << tableGroup
816 <<
"' (perhaps there was a collision with another user saving the "
817 "same group name?! Please try again with an incremented group "
819 <<
"Expected group count is " << memberMap.size() <<
", and found "
820 << countOfMatches <<
" matching tables during readback check."
824 __COUTT__ <<
"Readback check passed." << __E__;
828 auto end = std::chrono::high_resolution_clock::now();
830 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
832 __COUTT__ <<
"Time taken to call "
833 "DatabaseConfigurationInterface::saveTableGroup(tableGroup="
834 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
840 saveTableGroupMemberCache(memberMap, tableGroup);
844 __COUT_WARN__ <<
"Ignoring errors during saveTableGroupMemberCache()"
849 auto end = std::chrono::high_resolution_clock::now();
851 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
853 __COUTT__ <<
"Time taken to call "
854 "DatabaseConfigurationInterface::saveTableGroup(tableGroup="
855 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
861 __THROW__(result.second);
863 catch(std::exception
const& e)
865 __SS__ <<
"Database Interface Exception saveTableGroup for '" << tableGroup
872 __SS__ <<
"Database Interface Unknown exception saveTableGroup for '" << tableGroup
879 std::pair<std::string, TableVersion> DatabaseConfigurationInterface::saveCustomJSON(
880 const std::string& json,
const std::string& documentNameToSave)
const
883 __COUTT__ <<
"Saving doc '" << documentNameToSave <<
"'" << __E__;
888 TableBase::JSON_DOC_PREPEND + documentNameToSave);
890 std::set<TableVersion> versions = getVersions(&localDocSaver);
893 version = TableVersion::getNextVersion(*versions.rbegin());
895 version = TableVersion::DEFAULT;
903 __COUTS__(10) <<
"Saving JSON string: "
906 __COUTT__ <<
"Saving JSON doc as " << localDocSaver.getView().getTableName() <<
"("
907 << localDocSaver.getView().getVersion().
toString() <<
")" << __E__;
910 saveActiveVersion(&localDocSaver,
false );
913 localDocSaver.getView().getVersion());
915 catch(std::exception
const& e)
917 __SS__ <<
"Database Interface Exception saveCustomJSON for '" << documentNameToSave
920 __COUT_ERR__ << ss.str();
925 __SS__ <<
"Database Interface Unknown exception saveCustomJSON for '"
926 << documentNameToSave <<
".'\n";
927 __COUT_ERR__ << ss.str();
933 std::string DatabaseConfigurationInterface::loadCustomJSON(
934 const std::string& documentNameToLoad,
TableVersion documentVersionToLoad)
const
937 __COUTT__ <<
"Loading doc '" << documentNameToLoad <<
"-v" << documentVersionToLoad
943 TableBase::JSON_DOC_PREPEND + documentNameToLoad);
946 documentVersionToLoad);
948 fill(&localDocLoader, documentVersionToLoad);
950 __COUTS__(10) <<
"Loaded JSON doc string "
955 catch(std::exception
const& e)
957 __SS__ <<
"Database Interface Exception saveCustomJSON for '" << documentNameToLoad
958 <<
"-v" << documentVersionToLoad <<
"':\n\n"
960 __COUT_ERR__ << ss.str();
965 __SS__ <<
"Database Interface Unknown exception saveCustomJSON for '"
966 << documentNameToLoad <<
"-v" << documentVersionToLoad <<
".'\n";
967 __COUT_ERR__ << ss.str();
void saveTableGroup(table_version_map_t const &memberMap, std::string const &tableGroup) const override
create a new table group from the contents map
TableVersion findLatestVersion(const TableBase *table) const noexcept override
find the latest table version by table type
table_version_map_t getTableGroupMembers(std::string const &tableGroup, bool includeMetaDataTable=false) const override
return the contents of a table group
std::set< std::string > getAllTableGroupNames(std::string const &filterString="") const override
find all table groups in database
std::set< TableGroupKey > getKeys(const std::string &groupName) const override
find all configuration groups in database
std::set< TableVersion > getVersions(const TableBase *table) const noexcept override
find all table versions by table type
std::set< std::string > getAllTableNames(void) const override
returns a list of all table names
void fill(TableBase *table, TableVersion version) const override
read table from database
TableGroupKey findLatestGroupKey(const std::string &groupName) const noexcept override
void saveActiveVersion(const TableBase *table, bool overwrite=false) const override
write table to database
const std::string & getTableName(void) const
Getters.
TableVersion createTemporaryView(TableVersion sourceViewVersion=TableVersion(), TableVersion destTemporaryViewVersion=TableVersion::getNextTemporaryVersion())
source of -1, from MockUp, else from valid view version
std::string toString(void) const
toString
bool isInvalid(void) const
isInvalid
unsigned int version(void) const
void setVersion(const T &version)
< in included .icc source
const std::string & getCustomStorageData(void) const
Getters.
void setCustomStorageData(const std::string &storageData)
static std::string setToString(const std::set< T > &setToReturn, const std::string &delimeter=", ")
setToString ~
static std::string mapToString(const std::map< std::string, T > &mapToReturn, const std::string &primaryDelimeter=", ", const std::string &secondaryDelimeter=": ")
static void getMapFromString(const std::string &inputString, std::map< S, T > &mapToReturn, const std::set< char > &pairPairDelimiter={',', '|', '&'}, const std::set< char > &nameValueDelimiter={'=', ':'}, const std::set< char > &whitespace={' ', '\t', '\n', '\r'})
getMapFromString ~