Skip to content

Commit b83ac3a

Browse files
authored
Merge pull request #58 from sy-c/master
showCreate
2 parents 909073a + 98a8ca8 commit b83ac3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/infoLoggerAdminDB.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ int main(int argc, char* argv[])
4747
bool optArchive = 0; // move content of main message table to (time-based name) archive table
4848
bool optList = 0; // list current tables
4949
bool optNone = 0; // no command specified - test DB access only
50+
bool optShowCreate = 0; // print command used to create table
5051

5152
// configure log output
5253
log.setOutputFormat(SimpleLog::FormatOption::ShowSeverityTxt | SimpleLog::FormatOption::ShowMessage);
@@ -97,6 +98,8 @@ int main(int argc, char* argv[])
9798
optDestroy = 1;
9899
} else if (command == "list") {
99100
optList = 1;
101+
} else if (command == "showCreate") {
102+
optShowCreate = 1;
100103
} else if (command == "") {
101104
optNone = 1;
102105
} else {
@@ -228,6 +231,10 @@ int main(int argc, char* argv[])
228231
sqlTableDesriptionMessages += " partition by hash(timestamp div 86400) partitions 365";
229232
}
230233

234+
if (optShowCreate) {
235+
log.info("SQL create statement:\n\ncreate table " INFOLOGGER_TABLE_MESSAGES " %s;\n", sqlTableDesriptionMessages.c_str());
236+
}
237+
231238
if (optArchive) {
232239
log.info("Archiving main infoLogger table");
233240
auto t = std::time(nullptr);

0 commit comments

Comments
 (0)