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__ <<
"Error at time: " << time(0)
125 <<
"\n\n======> Database Interface Error while filling '"
126 << table->
getTableName() <<
"' version '" << versionstring
127 <<
"' - it appears that the connection to the database been lost. Please "
128 "check the database server and route to server.\n\n"
129 <<
"Here is the error detail:\n\n"
130 << result.second <<
"\n\n"
135 __SS__ <<
"\n\n======> Database Interface Error while filling '"
136 << table->
getTableName() <<
"' version '" << versionstring
137 <<
"' - are you sure this version exists? Or has the connection to the "
138 "database been lost?\n\n"
139 <<
"Here is the error detail:\n\n"
140 << result.second << __E__;
147 bool overwrite)
const
149 auto start = std::chrono::high_resolution_clock::now();
151 auto ifc = db::ConfigurationInterface{default_dbprovider};
153 auto versionstring = table->getView().getVersion().
toString();
154 std::stringstream preSaveJSONss;
155 table->getView().printJSON(preSaveJSONss);
161 auto result = overwrite ? ifc.template overwriteVersion<decltype(table), JsonData>(
162 table, versionstring, default_entity)
163 : ifc.template storeVersion<decltype(table), JsonData>(
164 table, versionstring, default_entity);
166 auto end = std::chrono::high_resolution_clock::now();
168 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
169 __COUTT__ <<
"Time taken to call "
170 "DatabaseConfigurationInterface::saveActiveVersion(tableName="
171 << table->
getTableName() <<
", versionstring=" << versionstring <<
") "
172 << duration <<
" milliseconds" << std::endl;
174 __COUTTV__(result.first);
175 __COUTVS__(10, result.second);
183 localDocLoader.changeVersionAndActivateView(
185 fill(&localDocLoader, table->getView().getVersion());
187 std::stringstream postSaveJSONss;
188 localDocLoader.getView().printJSON(postSaveJSONss);
190 __COUTVS__(2, preSaveJSONss.str());
191 __COUTVS__(2, postSaveJSONss.str());
195 auto preSaveJSON = preSaveJSONss.str();
196 auto postSaveJSON = postSaveJSONss.str();
197 size_t prec = 0, postc = 0;
198 for(; prec < preSaveJSON.size() && postc < postSaveJSON.size();
201 if(preSaveJSON[prec] ==
'\n' || preSaveJSON[prec] ==
'\t' ||
202 preSaveJSON[prec] ==
' ')
208 else if(postSaveJSON[postc] ==
'\n' || postSaveJSON[postc] ==
'\t' ||
209 postSaveJSON[postc] ==
' ')
215 if(preSaveJSON[prec] != postSaveJSON[postc])
217 __COUTT__ <<
"Mismatch at preSaveJSON[" << prec
218 <<
"] != postSaveJSON[" << postc <<
"] ... "
219 << preSaveJSON.substr(prec, 30)
220 <<
" != " << postSaveJSON.substr(postc, 30) << __E__;
233 __COUT__ <<
"NOT Same";
234 auto end = std::chrono::high_resolution_clock::now();
236 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
239 <<
"Time taken to call "
240 "DatabaseConfigurationInterface::saveActiveVersion(tableName="
241 << table->
getTableName() <<
", versionstring=" << versionstring
242 <<
") " << duration <<
" milliseconds" << std::endl;
244 __SS__ <<
"Error saving table '" << table->
getTableName() <<
"'-v"
246 <<
" (perhaps there was a collision with another user saving the "
247 "same table name/version?! Please try again with an "
248 "incremented table version). "
249 <<
"Expected data size is " << preSaveJSONss.str().size()
250 <<
" and readback found size of " << postSaveJSONss.str().size()
251 <<
" with character mismatches." << __E__;
255 auto end = std::chrono::high_resolution_clock::now();
257 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
259 __COUTT__ <<
"Time taken to call "
260 "DatabaseConfigurationInterface::saveActiveVersion(tableName="
261 << table->
getTableName() <<
", versionstring=" << versionstring
262 <<
") " << duration <<
" milliseconds" << std::endl;
268 __SS__ <<
"Database Interface saveActiveVersion Error:" << result.second << __E__;
277 auto versions = getVersions(table);
281 __COUTT__ <<
"Table Name: " << table->getTableName() << __E__;
282 __SS__ <<
"All Versions: ";
283 for(
auto& v : versions)
286 __COUTT__ <<
"\n" << ss.str();
292 return *(versions.rbegin());
301 auto start = std::chrono::high_resolution_clock::now();
303 auto ifc = db::ConfigurationInterface{default_dbprovider};
304 auto result = ifc.template getVersions<decltype(table)>(table, default_entity);
306 auto end = std::chrono::high_resolution_clock::now();
308 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
310 <<
"Time taken to call DatabaseConfigurationInterface::getVersions(tableName="
311 << table->getTableName() <<
") " << duration <<
" milliseconds." << std::endl;
313 auto resultSet = std::set<TableVersion>{};
314 for(std::string
const& version : result)
315 resultSet.insert(
TableVersion(std::stol(version, 0, 10)));
321 catch(std::exception
const& e)
323 __COUT_WARN__ <<
"Database Interface Exception:" << e.what() <<
"\n";
332 auto start = std::chrono::high_resolution_clock::now();
334 auto ifc = db::ConfigurationInterface{default_dbprovider};
335 auto collection_name_prefix = std::string{};
337 auto result = ifc.listCollections(collection_name_prefix);
339 auto end = std::chrono::high_resolution_clock::now();
341 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
343 <<
"Time taken to call "
344 "DatabaseConfigurationInterface::getAllTableNames(collection_name_prefix="
345 << collection_name_prefix <<
") " << duration <<
" milliseconds." << std::endl;
349 catch(std::exception
const& e)
351 __SS__ <<
"Database Interface Exception:" << e.what() <<
"\n";
356 __SS__ <<
"Database Interface Unknown exception.\n";
363 std::string
const& filterString)
const
366 auto start = std::chrono::high_resolution_clock::now();
368 auto ifc = db::ConfigurationInterface{default_dbprovider};
370 auto result = std::set<std::string>();
372 if(filterString ==
"")
373 result = ifc.findGlobalConfigurations(
"*");
377 result = ifc.findGlobalConfigurations(filterString +
"*");
382 auto end = std::chrono::high_resolution_clock::now();
384 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
385 __COUTT__ <<
"Time taken to call "
386 "DatabaseConfigurationInterface::getAllTableGroupNames(filterString="
387 << filterString <<
") " << duration <<
" milliseconds." << std::endl;
391 catch(std::exception
const& e)
393 __SS__ <<
"Filter string '" << filterString
394 <<
"' yielded Database Interface Exception:" << e.what() <<
"\n";
399 __SS__ <<
"Filter string '" << filterString
400 <<
"' yielded Database Interface Unknown exception.\n";
408 const std::string& groupName)
const noexcept
416 TableBase::GROUP_CACHE_PREPEND + groupName);
418 findLatestVersion(&localGroupMemberCacheLoader);
419 __COUTTV__(lastestGroupCacheKey);
425 __COUT__ <<
"Ignoring cache loading error." << __E__;
430 return *(keys.crbegin());
439 const std::string& groupName)
const
441 std::set<TableGroupKey> retSet;
444 if(n.find(groupName) == 0)
452 std::string
const& tableGroup,
bool includeMetaDataTable )
const
455 auto start = std::chrono::high_resolution_clock::now();
470 table_version_map_t retMap = getCachedTableGroupMembers(tableGroup);
471 __COUTV__(tableGroup);
474 if(!includeMetaDataTable)
477 auto metaTable = retMap.find(TableBase::GROUP_METADATA_TABLE_NAME);
478 if(metaTable != retMap.end())
479 retMap.erase(metaTable);
482 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
483 std::chrono::high_resolution_clock::now() - start)
485 __COUTT__ <<
"Time taken to call "
486 "DatabaseConfigurationInterface::getTableGroupMembers(tableGroup="
487 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
492 __COUTT__ <<
"Ignoring error "
493 "DatabaseConfigurationInterface::getTableGroupMembers(tableGroup="
494 << tableGroup <<
") " << __E__;
497 auto ifc = db::ConfigurationInterface{default_dbprovider};
498 auto result = ifc.loadGlobalConfiguration(tableGroup);
502 for(
auto& item : result)
503 __COUTT__ <<
"====================> " << item.configuration <<
": "
504 << item.version << __E__;
507 auto to_map = [](
auto const& inputList,
bool includeMetaDataTable) {
508 auto resultMap = table_version_map_t{};
510 std::for_each(inputList.begin(), inputList.end(), [&resultMap](
auto const& info) {
511 resultMap[info.configuration] = std::stol(info.version, 0, 10);
514 if(!includeMetaDataTable)
517 auto metaTable = resultMap.find(TableBase::GROUP_METADATA_TABLE_NAME);
518 if(metaTable != resultMap.end())
519 resultMap.erase(metaTable);
524 table_version_map_t retMap = to_map(result, includeMetaDataTable);
527 saveTableGroupMemberCache(retMap, tableGroup);
532 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
533 std::chrono::high_resolution_clock::now() - start)
535 __COUTT__ <<
"Time taken to call "
536 "DatabaseConfigurationInterface::getTableGroupMembers(tableGroup="
537 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
541 catch(std::exception
const& e)
543 __SS__ <<
"Database Interface Exception getting Group's member tables for '"
544 << tableGroup <<
"':\n\n"
546 if(std::string(e.what()).find(
"connection refused") != std::string::npos)
548 ss <<
"\n\nConnection to database refused. Perhaps your ssh tunnel has "
555 __SS__ <<
"Database Interface Unknown exception getting Group's member tables for '"
556 << tableGroup <<
".'\n";
557 __COUT_ERR__ << ss.str();
564 table_version_map_t DatabaseConfigurationInterface::getCachedTableGroupMembers(
565 std::string
const& tableGroup)
const
568 table_version_map_t retMap;
582 std::size_t vi = tableGroup.rfind(
"_v");
583 std::string groupName = tableGroup.substr(0, vi);
584 std::string groupKey = tableGroup.substr(vi + 2);
585 __COUTT__ <<
"Getting cache for " << groupName <<
"(" << groupKey <<
")" << __E__;
590 TableBase::GROUP_CACHE_PREPEND + groupName);
596 __COUTT__ <<
"IS_FILESYSTEM_DB=true, so checking cached keys for " << groupName
597 <<
"(" << groupKey <<
")" << __E__;
598 std::set<TableVersion> versions = getVersions(&localGroupMemberCacheSaver);
599 if(versions.find(localVersion) == versions.end())
601 __SS__ <<
"Cached member table versions not found for " << groupName <<
"("
602 << groupKey <<
")" << __E__;
607 localGroupMemberCacheSaver.changeVersionAndActivateView(
608 localGroupMemberCacheSaver.createTemporaryView(), localVersion);
610 fill(&localGroupMemberCacheSaver, localVersion);
612 __COUTS__(20) <<
"Loaded cache member map string "
613 << localGroupMemberCacheSaver.getViewP()->getCustomStorageData()
618 std::string jsonClean =
"";
619 const std::string& json =
620 localGroupMemberCacheSaver.getViewP()->getCustomStorageData();
622 if(c ==
'{' || c ==
'}' || c ==
'"' || c ==
' ')
626 __COUTVS__(21, jsonClean);
630 __COUTS__(20) <<
"Loaded cache member map string "
635 catch(std::exception
const& e)
637 __SS__ <<
"Database Interface Exception getCachedTableGroupMembers for '"
638 << tableGroup <<
"':\n\n"
644 __SS__ <<
"Database Interface Unknown exception getCachedTableGroupMembers for '"
645 << tableGroup <<
".'\n";
651 void DatabaseConfigurationInterface::saveTableGroupMemberCache(
652 table_version_map_t
const& memberMap, std::string
const& tableGroup)
const
667 std::size_t vi = tableGroup.rfind(
"_v");
668 std::string groupName = tableGroup.substr(0, vi);
669 std::string groupKey = tableGroup.substr(vi + 2);
670 __COUTT__ <<
"Saving cache for " << groupName <<
"(" << groupKey <<
")" << __E__;
675 TableBase::GROUP_CACHE_PREPEND + groupName);
676 localGroupMemberCacheSaver.changeVersionAndActivateView(
677 localGroupMemberCacheSaver.createTemporaryView(),
681 std::stringstream groupCacheData;
682 groupCacheData <<
"{ ";
683 for(
const auto& member : memberMap)
684 groupCacheData << (member.first == memberMap.begin()->first ?
"" :
", ")
686 "\"" << member.first <<
"\" : \"" << member.second <<
"\"";
687 groupCacheData <<
"}";
689 localGroupMemberCacheSaver.getViewP()->setCustomStorageData(groupCacheData.str());
692 __COUTT__ <<
"Saving member map string "
693 << localGroupMemberCacheSaver.getViewP()->getCustomStorageData() << __E__;
695 __COUTT__ <<
"Saving cache table "
696 << localGroupMemberCacheSaver.getView().getTableName() <<
"("
697 << localGroupMemberCacheSaver.getView().getVersion().toString() <<
")"
701 saveActiveVersion(&localGroupMemberCacheSaver,
false );
704 catch(std::exception
const& e)
706 __SS__ <<
"Database Interface Exception saveTableGroupMemberCache for '" << tableGroup
709 __COUT_ERR__ << ss.str();
714 __SS__ <<
"Database Interface Unknown exception saveTableGroupMemberCache for '"
715 << tableGroup <<
".'\n";
716 __COUT_ERR__ << ss.str();
723 std::string
const& tableGroup)
const
726 auto start = std::chrono::high_resolution_clock::now();
728 auto ifc = db::ConfigurationInterface{default_dbprovider};
732 auto to_list = [](
auto const& inputMap) {
733 auto resultList = VersionInfoList_t{};
737 std::back_inserter(resultList),
738 [](
auto const& mapEntry) {
739 return VersionInfoList_t::value_type{
740 mapEntry.first, mapEntry.second.toString(), default_entity};
747 auto result = IS_FILESYSTEM_DB
748 ? ifc.storeGlobalConfiguration(to_list(memberMap), tableGroup)
749 : ifc.storeGlobalConfiguration_mt(to_list(memberMap), tableGroup);
751 __COUTTV__(result.first);
752 __COUTVS__(10, result.second);
754 auto end = std::chrono::high_resolution_clock::now();
756 std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
758 <<
"Time taken to call DatabaseConfigurationInterface::saveTableGroup(tableGroup="
759 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
764 auto readbackResult = ifc.loadGlobalConfiguration(tableGroup);
767 for(
auto& item : readbackResult)
768 __COUTT__ <<
"--==> " << item.configuration <<
": " << item.version
771 size_t countOfMatches = 0;
772 for(
auto& item : readbackResult)
774 __COUTT__ <<
"====================> " << item.configuration <<
": "
775 << item.version << __E__;
776 const auto& it = memberMap.find(item.configuration);
777 if(it == memberMap.end() ||
778 it->second !=
TableVersion(std::stol(item.version, 0, 10)))
780 auto end = std::chrono::high_resolution_clock::now();
782 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
785 <<
"Time taken to call "
786 "DatabaseConfigurationInterface::saveTableGroup(tableGroup="
787 << tableGroup <<
") " << duration <<
" milliseconds."
789 __SS__ <<
"Error saving group '" << tableGroup
790 <<
"' (perhaps there was a collision with another user saving "
791 "the same group name?! Please try again with an "
792 "incremented group key)). Table '"
793 << item.configuration <<
"'-v" << item.version
794 <<
" was unexpectedly read back as a member table after the "
795 "attempted group save. Expected member tables of group '"
796 << tableGroup <<
"' are as follows:" << __E__;
797 for(
const auto& memberPair : memberMap)
798 ss <<
"\t" << memberPair.first <<
"-v" << memberPair.second
807 if(countOfMatches != memberMap.size())
809 auto end = std::chrono::high_resolution_clock::now();
811 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
813 __COUTT__ <<
"Time taken to call "
814 "DatabaseConfigurationInterface::saveTableGroup(tableGroup="
815 << tableGroup <<
") " << duration <<
" milliseconds."
817 __SS__ <<
"Error saving group '" << tableGroup
818 <<
"' (perhaps there was a collision with another user saving the "
819 "same group name?! Please try again with an incremented group "
821 <<
"Expected group count is " << memberMap.size() <<
", and found "
822 << countOfMatches <<
" matching tables during readback check."
826 __COUTT__ <<
"Readback check passed." << __E__;
830 auto end = std::chrono::high_resolution_clock::now();
832 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
834 __COUTT__ <<
"Time taken to call "
835 "DatabaseConfigurationInterface::saveTableGroup(tableGroup="
836 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
842 saveTableGroupMemberCache(memberMap, tableGroup);
846 __COUT_WARN__ <<
"Ignoring errors during saveTableGroupMemberCache()"
851 auto end = std::chrono::high_resolution_clock::now();
853 std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
855 __COUTT__ <<
"Time taken to call "
856 "DatabaseConfigurationInterface::saveTableGroup(tableGroup="
857 << tableGroup <<
") " << duration <<
" milliseconds." << std::endl;
863 __THROW__(result.second);
865 catch(std::exception
const& e)
867 __SS__ <<
"Database Interface Exception saveTableGroup for '" << tableGroup
874 __SS__ <<
"Database Interface Unknown exception saveTableGroup for '" << tableGroup
881 std::pair<std::string, TableVersion> DatabaseConfigurationInterface::saveCustomJSON(
882 const std::string& json,
const std::string& documentNameToSave)
const
885 __COUTT__ <<
"Saving doc '" << documentNameToSave <<
"'" << __E__;
890 TableBase::JSON_DOC_PREPEND + documentNameToSave);
892 std::set<TableVersion> versions = getVersions(&localDocSaver);
895 version = TableVersion::getNextVersion(*versions.rbegin());
897 version = TableVersion::DEFAULT;
905 __COUTS__(10) <<
"Saving JSON string: "
908 __COUTT__ <<
"Saving JSON doc as " << localDocSaver.getView().getTableName() <<
"("
909 << localDocSaver.getView().getVersion().
toString() <<
")" << __E__;
912 saveActiveVersion(&localDocSaver,
false );
915 localDocSaver.getView().getVersion());
917 catch(std::exception
const& e)
919 __SS__ <<
"Database Interface Exception saveCustomJSON for '" << documentNameToSave
922 __COUT_ERR__ << ss.str();
927 __SS__ <<
"Database Interface Unknown exception saveCustomJSON for '"
928 << documentNameToSave <<
".'\n";
929 __COUT_ERR__ << ss.str();
935 std::string DatabaseConfigurationInterface::loadCustomJSON(
936 const std::string& documentNameToLoad,
TableVersion documentVersionToLoad)
const
939 __COUTT__ <<
"Loading doc '" << documentNameToLoad <<
"-v" << documentVersionToLoad
945 TableBase::JSON_DOC_PREPEND + documentNameToLoad);
948 documentVersionToLoad);
950 fill(&localDocLoader, documentVersionToLoad);
952 __COUTS__(10) <<
"Loaded JSON doc string "
957 catch(std::exception
const& e)
959 __SS__ <<
"Database Interface Exception saveCustomJSON for '" << documentNameToLoad
960 <<
"-v" << documentVersionToLoad <<
"':\n\n"
962 __COUTS__(3) << ss.str();
967 __SS__ <<
"Database Interface Unknown exception saveCustomJSON for '"
968 << documentNameToLoad <<
"-v" << documentVersionToLoad <<
".'\n";
969 __COUTS__(3) << 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 ~
static std::string stackTrace(void)