5#include "dbclient/KM3NeTDBClient.h"
19 static const std::string help_t =
"help";
29int main(
int argc,
char **argv)
48 JParser<> zap(
"Auxiliary program to print data from data base.");
56 zap[
'A'] =
make_field(api,
"API, possible values X.Y.Z[/help] ('apiv2') or \"\" ('streamds')") =
"";
64 catch(
const exception &error) {
74 ResultSet& rs = getResultSet(
query, selection);
76 for (
unsigned int i = 0; i != rs.FieldCount(); ++i) {
77 cout << (i != 0 ?
csv :
"") <<
setw(width) << left << rs.FieldName(i) << flush;
82 for (
unsigned int i = 0; i != rs.FieldCount(); ++i) {
83 cout << (i != 0 ?
csv :
"") <<
setw(width) << left << rs.GetString(i) << flush;
103 if (is.peek() ==
EOF)
104 *(JDB::get()->APIv2Select(version.toString().c_str(),
query.c_str(), selection)) >>
js;
105 else if (is.get() ==
'/' && is >> buffer && buffer ==
help_t)
106 *(JDB::get()->APIv2Help(version.toString().c_str(), (
query !=
"" ?
query.c_str() :
"all/h"))) >>
js;
108 FATAL(
"Error reading API version <" << api <<
">." <<
endl);
114 FATAL(
"Error reading API version <" << api <<
">." <<
endl);
118 catch(
const exception& error) {
General purpose messaging.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Wrapper class for server name.
Auxiliary class for version identifier.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure to print (part of) JSon data.