LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Table.h
Go to the documentation of this file.
1 #ifndef __DBITABLE_HPP_
2 #define __DBITABLE_HPP_
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 #include <unordered_map>
8 #include <cstdlib>
9 #include <wda.h>
10 
14 #include "nuevdb/IFDatabase/Row.h"
15 
16 // Forward declarations for postgres types
17 struct pg_conn;
18 typedef pg_conn PGconn;
19 struct pg_result;
20 typedef pg_result PGresult;
21 
22 namespace nutools {
23  namespace dbi {
24 
25  enum DBTableType {
31  };
32 
33  enum DataSource {
39  };
40 
47  class Table
48  {
49  public:
50 
51  Table();
52  // Table(std::string fileName);
53  Table(std::string schemaName, std::string tableName,
54  int tableType=kGenericTable,
55  std::string dbhost="", std::string dbname="",
56  std::string dbport="", std::string dbuser="");
57  ~Table();
58 
59  std::string Name() { return fTableName; }
60  std::string DBName() { return fDBName;}
61  std::string DBHost() { return fDBHost;}
62  std::string User() { return fUser; }
63  std::string Role() { return fRole; }
64  std::string DBPort() { return fDBPort; }
65  int TableType() { return fTableType; }
66  int DataSource() { return fDataSource; }
67  int DataTypeMask() { return fDataTypeMask; }
68 
69  void SetTableName(std::string tname);
70  void SetTableName(const char* tname);
71 
72  void SetDataSource(std::string ds);
73  void SetDataSource(int ids);
74 
75  bool SetTableType(int t);
76  void SetDataTypeMask(int mask) { fDataTypeMask = mask;}
77 
78  void SetIgnoreEnvVar(bool f) { fIgnoreEnvVar = f;}
79  void SetUser(std::string uname) { fUser = uname; }
80  void SetUser(const char* uname) { fUser = uname; }
81  bool SetRole(std::string role);
82  bool SetRole(const char* role);
83  void SetDBName(std::string dbname) { fDBName = dbname; }
84  void SetDBName(const char* dbname) { fDBName = dbname; }
85  void SetDBHost(std::string dbhost) { fDBHost = dbhost; }
86  void SetDBHost(const char* dbhost) { fDBHost = dbhost; }
87  void SetDBPort(std::string p) { fDBPort = p; }
88  void SetDBPort(const char* p) { fDBPort = p; }
89  void SetDBInfo(std::string name, std::string host, std::string port,
90  std::string user);
91  void SetDBInfo(const char* name, const char* host, const char* port,
92  const char* user);
93 
94  bool SetPasswordFile(const char* fname=0);
95  void ClearPassword() { fPassword=""; }
97 
98  void ResetRole() { fRole = fUser; }
99 
100  void SetVerbosity(int i) { fVerbosity = i;}
101 
102  int NCol() {return fCol.size();}
103  int NRow() {return fRow.size();}
104 
105  void Clear() {
106  fRow.clear(); fValidityStart.clear(); fValidityEnd.clear();
107  fOrderCol.clear(); fDistinctCol.clear(); fNullList.clear();
108  fValiditySQL = "";
109  fValidityChanged = true;
110  }
111 
112  void ClearRows() { fRow.clear(); fNullList.clear(); fValidityChanged=true;}
113 
114  nutools::dbi::Row* const GetRow(int i);
115 
116  void AddRow(const Row* row);
117  void AddRow(const Row& row);
118  int AddCol(std::string cname, std::string ctype);
119 
120  void AddEmptyRows(unsigned int nrow);
121 
122  bool RemoveRow(int i);
123 
126  nutools::dbi::Row* const NewRow() { Row* r = new Row(fCol); return r;}
127 
128  std::vector<std::string> GetColNames();
129  std::map<std::string,int> GetColNameToIndexMap();
130  std::string GetColName(int i) {return fCol[i].Name(); }
131  int GetColIndex(std::string cname);
132 
133  const nutools::dbi::ColumnDef* GetCol(int i) {return &fCol[i]; }
134  const nutools::dbi::ColumnDef* GetCol(std::string& cname);
135  const nutools::dbi::ColumnDef* GetCol(const char* cname)
136  { std::string cstr(cname); return GetCol(cstr); }
137 
138  void SetTolerance(std::string& cname, float t);
139  float Tolerance(std::string& cname);
140 
141  bool ExistsInDB();
142  bool ExecuteSQL(std::string cmd, PGresult*& res);
143 
144  bool LoadFromCSV(std::string fname);
145  bool LoadFromCSV(const char* fname)
146  { return LoadFromCSV(std::string(fname)); }
147 
148  bool LoadFromDB();
149  bool WriteToDB(bool commit=true);
150  bool WriteToCSV(std::string fname, bool appendToFile=false, bool writeColNames=false);
151  bool WriteToCSV(const char* fname, bool appendToFile=false, bool writeColNames=false)
152  { return WriteToCSV(std::string(fname),appendToFile,writeColNames); }
153 
154  void ClearValidity();
155 
156  bool AddDistinctColumn(unsigned int i);
157  bool AddDistinctColumn(std::string col);
158  bool AddDistinctColumn(const char* col)
159  { return AddDistinctColumn(std::string(col)); }
160  bool RemoveDistinctColumn(unsigned int i);
161  bool RemoveDistinctColumn(std::string col);
162  bool RemoveDistinctColumn(const char* col)
163  { return RemoveDistinctColumn(std::string(col)); }
164 
165  bool AddOrderColumn(unsigned int i);
166  bool AddOrderColumn(std::string col);
167  bool AddOrderColumn(const char* col)
168  { return AddOrderColumn(std::string(col)); }
169  bool RemoveOrderColumn(unsigned int i);
170  bool RemoveOrderColumn(std::string col);
171  bool RemoveOrderColumn(const char* col)
172  { return RemoveOrderColumn(std::string(col)); }
173 
174  void SetSelectLimit(int limit) { fSelectLimit=limit; }
175  void SetSelectOffset(int offset) { fSelectOffset=offset; }
176 
177  void SetOrderDesc() { fDescOrder = true; }
178  void SetOrderAsc() { fDescOrder = false; }
179 
180  void AddExcludeCol(std::string col) {fExcludeCol.push_back(col); }
181  void ClearExcludedCols() { fExcludeCol.clear(); }
182 
183  bool GetCurrSeqVal(std::string col, long& iseq);
184  bool GetCurrSeqVal(const char* col, long& iseq)
185  { return GetCurrSeqVal(std::string(col), iseq); }
186 
187  // bool HasPKey() { return fTable->hasDBPKey(); }
188 
189  int GetNPKeyCol() { return fPKeyList.size(); }
190  const nutools::dbi::ColumnDef* GetPKeyCol(int i) { return fPKeyList[i]; }
191  /*
192  int GetNUnique() { return fTable->getDBUniqueCount(); }
193  const dBRow_t* GetUniqueRow(int i) {
194  if (fTable->hasDBUnique() &&
195  i < this->GetNUnique())
196  return &fTable->getDBUnique(i);
197  else return 0;
198  }
199  */
200  /*
201  int GetNCheck() { return fTable->getDBCheckCount(); }
202  std::string GetCheckConstraint(int i) {
203  return std::string(fTable->getDBCheck(i).getConstraint());
204  }
205  */
206  void PrintPQErrorMsg() const;
207 
208  std::string GetValiditySQL() { return fValiditySQL; }
209  void SetValiditySQL(std::string cmd) { fValiditySQL = cmd; fValidityChanged=true;}
210 
211  bool SetDetector(std::string det);
212  bool GetDetector(std::string& det ) const;
213 
214  void SetSchema(std::string s) { fSchema = s; }
215  std::string Schema() { return fSchema; }
216 
217  template <class T>
218  bool SetValidityRange(std::string cname, T start, T end)
219  {
220  const ColumnDef* c = this->GetCol(cname);
221  if (c) {
222  // check to see if this makes sense for a boolean column.
223  if (c->Type() == "bool")
224  if (start != end) return false;
225 
226  // check to see that this column wasn't already added to valid.
227  // list if it is, overwrite it
228 
229  unsigned int i=0;
230  for (; i<fValidityStart.size(); ++i)
231  if (fValidityStart[i].Name() == c->Name()) break;
232 
233  if (i == fValidityStart.size()) {
234  fValidityStart.push_back(ColumnDef(*c));
235  fValidityEnd.push_back(ColumnDef(*c));
236  }
237  std::stringstream startSS;
238  startSS << start;
239  std::stringstream endSS;
240  endSS << end;
241  fValidityStart[i].SetValue(startSS.str());
242  fValidityEnd[i].SetValue(endSS.str());
243  fValidityChanged=true;
244  return true;
245  }
246 
247  return false;
248  }
249 
250  template <class T>
251  bool SetValidityRange(std::string cname, T start) {
252  return (this->SetValidityRange(cname,start,start));
253  }
254 
255  void RemoveValidityRange(std::string& cname);
256  void RemoveValidityRange(const char* cname)
257  { std::string cstr(cname); return RemoveValidityRange(cstr); fValidityChanged=true;}
258 
259  void PrintColumns();
260 
261  bool GetConnection(int ntry=0);
262  bool CloseConnection();
263  void SetConnectionTimeout(int n) { fConnectionTimeout=n;} // units in sec
265  bool ResetConnectionInfo();
266 
267  void CacheDBCommand(std::string cmd);
268 
269  friend std::ostream& operator<< (std::ostream& stream, const Table& t);
270 
271  void SetMinTSVld(double t) { fMinTSVld = t;}
272  void SetMaxTSVld(double t) { fMaxTSVld = t;}
273 
274  double GetMaxTSVld() const {return fMaxTSVld; }
275  double GetMinTSVld() const {return fMinTSVld; }
276 
277  void SetTag(std::string s) { fTag = s; }
278  std::string GetTag() { return fTag; }
279  bool Tag(std::string tn="", bool override=false);
280 
281  bool Load();
282  bool Write(bool commit=true);
283 
284  void ClearChanRowMap() { fChanRowMap.clear(); }
285  void FillChanRowMap();
286  int NVldRows(uint64_t channel) { return fChanRowMap[channel].size(); }
287  int NVldChannels() { return fChanRowMap.size(); }
288  std::vector<uint64_t> VldChannels() { return fChannelVec; }
289 
290  nutools::dbi::Row* GetVldRow(uint64_t channel, double t);
291  std::vector<nutools::dbi::Row*> GetVldRows(uint64_t channel);
292 
293  void SetRecordTime(double t);
294  void ClearRecordTime() { fHasRecordTime = false;}
295 
296  void EnableFlushCache() { fFlushCache = true; }
297  void DisableFlushCache() { fFlushCache = false; }
298 
299  void DisableCache() { fDisableCache = true; }
300  void EnableCache() { fDisableCache = false; }
301 
302  void SetWSURL(std::string url) { fWSURL = url;}
303  void SetQEURL(std::string url) { fQEURL = url;}
304 
305  void SetTimeQueries(bool f) {fTimeQueries = f; }
306  void SetTimeParsing(bool f) {fTimeParsing = f; }
307  bool TimeQueries() {return fTimeQueries; }
308  bool TimeParsing() {return fTimeParsing; }
309 
310  void SetMinChannel(uint64_t chan) {fMinChannel = chan;}
311  void SetMaxChannel(uint64_t chan) {fMaxChannel = chan;}
312  void SetChannelRange(uint64_t chan1, uint64_t chan2)
313  { fMinChannel=chan1; fMaxChannel=chan2;}
314 
315  void PrintVMUsed();
316  void PrintPMUsed();
317 
318  bool GetColsFromDB(std::vector<std::string> pkeyList = {});
319 
320  void SetFolder(std::string f) { fFolder = f; }
321  std::string Folder() { return fFolder; }
322 
323  private:
324 
325  bool LoadConditionsTable();
327  bool LoadNonConditionsTable();
328  bool GetDataFromWebService(Dataset&, std::string);
329 
330  void Reset();
331  bool GetConnectionInfo(int ntry=0);
332 
333  bool CheckForNulls();
334 
335  bool MakeConditionsCSVString(std::stringstream& ss);
336 
337  std::string GetPassword();
338 
339  int ParseSelfStatusLine(char* line);
340 
348  bool fIgnoreDB;
357  short fVerbosity;
358 
365  uint64_t fMinChannel;
366  uint64_t fMaxChannel;
367 
368  std::string fTableName;
369  std::string fUser;
370  std::string fRole;
371  std::string fDBPort;
372  std::string fDBHost;
373  std::string fDBName;
374  std::string fSchema;
375 
376  std::string fDBCacheFile;
377  std::string fPassword;
378  std::string fValiditySQL;
379  std::string fDetector;
380  std::string fFolder;
381 
382  std::string fTag;
383  std::string fWSURL;
384  std::string fUConDBURL;
385  std::string fQEURL;
386 
387  std::vector<nutools::dbi::ColumnDef> fCol;
388  std::vector<nutools::dbi::Row> fRow;
389 
390  std::vector<nutools::dbi::ColumnDef> fValidityStart;
391  std::vector<nutools::dbi::ColumnDef> fValidityEnd;
392  std::vector<const nutools::dbi::ColumnDef*> fPKeyList;
393  std::vector<const nutools::dbi::ColumnDef*> fDistinctCol;
394  std::vector<const nutools::dbi::ColumnDef*> fOrderCol;
395  std::vector<std::pair<int,int> > fNullList;
396  std::vector<std::string> fExcludeCol;
397 
398  std::vector<uint64_t> fChannelVec;
399  std::unordered_map<uint64_t,std::vector<nutools::dbi::Row*> > fChanRowMap;
400 
402 
403  // static boost::mutex _xsdLock;
404 
405  double fMaxTSVld;
406  double fMinTSVld;
407  double fRecordTime;
408 
409 
410  }; // class end
411 
412  //************************************************************
413 
414  inline std::ostream& operator<< (std::ostream& stream, const Table& t) {
415  for (unsigned int j=0; j<t.fRow.size(); ++j) {
416  stream << t.fRow[j] << std::endl;
417  }
418  return stream;
419  }
420 
421  } // namespace dbi close
422 } // namespace nutools close
423 
424 #endif
std::string fUser
Definition: Table.h:369
TRandom r
Definition: spectrum.C:23
void FillChanRowMap()
Definition: Table.cpp:1989
bool addUpdateUser
Definition: Table.h:344
int GetConnectionTimeout()
Definition: Table.h:264
std::string Name()
Definition: Table.h:59
bool MakeConditionsCSVString(std::stringstream &ss)
Definition: Table.cpp:2305
double GetMaxTSVld() const
Definition: Table.h:274
bool GetConnection(int ntry=0)
Definition: Table.cpp:759
void CacheDBCommand(std::string cmd)
Definition: Table.cpp:438
std::vector< nutools::dbi::ColumnDef > fCol
Definition: Table.h:387
void SetMinChannel(uint64_t chan)
Definition: Table.h:310
int DataSource()
Definition: Table.h:66
std::string GetValiditySQL()
Definition: Table.h:208
void RemoveValidityRange(const char *cname)
Definition: Table.h:256
void PrintColumns()
Definition: Table.cpp:645
void SetTimeQueries(bool f)
Definition: Table.h:305
std::vector< const nutools::dbi::ColumnDef * > fOrderCol
Definition: Table.h:394
void SetSelectOffset(int offset)
Definition: Table.h:175
uint64_t fMaxChannel
Definition: Table.h:366
bool fDisableCache
Definition: Table.h:354
bool SetValidityRange(std::string cname, T start)
Definition: Table.h:251
void DisablePasswordAccess()
Definition: Table.h:96
const nutools::dbi::ColumnDef * GetCol(int i)
Definition: Table.h:133
bool addInsertTime
Definition: Table.h:341
void ClearValidity()
Definition: Table.cpp:484
std::string DBHost()
Definition: Table.h:61
bool AddDistinctColumn(const char *col)
Definition: Table.h:158
std::string fQEURL
Definition: Table.h:385
void SetDataSource(std::string ds)
Definition: Table.cpp:537
std::vector< nutools::dbi::Row * > GetVldRows(uint64_t channel)
Definition: Table.cpp:2028
void ClearChanRowMap()
Definition: Table.h:284
void SetWSURL(std::string url)
Definition: Table.h:302
bool WriteToCSV(const char *fname, bool appendToFile=false, bool writeColNames=false)
Definition: Table.h:151
void SetDBHost(const char *dbhost)
Definition: Table.h:86
std::string DBPort()
Definition: Table.h:64
double fMinTSVld
Definition: Table.h:406
std::map< std::string, int > GetColNameToIndexMap()
Definition: Table.cpp:598
double GetMinTSVld() const
Definition: Table.h:275
bool ExecuteSQL(std::string cmd, PGresult *&res)
Definition: Table.cpp:1030
void SetOrderAsc()
Definition: Table.h:178
bool LoadFromCSV(const char *fname)
Definition: Table.h:145
std::vector< std::string > fExcludeCol
Definition: Table.h:396
void SetUser(const char *uname)
Definition: Table.h:80
bool SetPasswordFile(const char *fname=0)
fname should be the name of the file
Definition: Table.cpp:859
bool AddOrderColumn(const char *col)
Definition: Table.h:167
void EnableFlushCache()
Definition: Table.h:296
int NVldChannels()
Definition: Table.h:287
bool AddOrderColumn(unsigned int i)
Definition: Table.cpp:2537
std::string Schema()
Definition: Table.h:215
std::vector< nutools::dbi::ColumnDef > fValidityStart
Definition: Table.h:390
bool RemoveRow(int i)
Definition: Table.cpp:392
int GetNPKeyCol()
Definition: Table.h:189
void SetValiditySQL(std::string cmd)
Definition: Table.h:209
bool TimeParsing()
Definition: Table.h:308
void SetDBName(const char *dbname)
Definition: Table.h:84
void SetIgnoreEnvVar(bool f)
Definition: Table.h:78
bool CloseConnection()
Definition: Table.cpp:837
int fConnectionTimeout
Definition: Table.h:361
bool fIgnoreEnvVar
Definition: Table.h:345
std::string GetColName(int i)
Definition: Table.h:130
Simple service to provide a RunHistory configured to the right run.
Definition: Column.cpp:14
void SetChannelRange(uint64_t chan1, uint64_t chan2)
Definition: Table.h:312
void DisableCache()
Definition: Table.h:299
void ResetRole()
Definition: Table.h:98
std::string fFolder
Definition: Table.h:380
bool RemoveOrderColumn(unsigned int i)
Definition: Table.cpp:2554
bool LoadFromCSV(std::string fname)
Definition: Table.cpp:1298
PGconn * fConnection
Definition: Table.h:401
bool GetConnectionInfo(int ntry=0)
Definition: Table.cpp:699
void EnableCache()
Definition: Table.h:300
std::vector< const nutools::dbi::ColumnDef * > fPKeyList
Definition: Table.h:392
bool CheckForNulls()
Definition: Table.cpp:422
void ClearRecordTime()
Definition: Table.h:294
void DisableFlushCache()
Definition: Table.h:297
bool LoadNonConditionsTable()
Definition: Table.cpp:1758
TFile f
Definition: plotHisto.C:6
void RemoveValidityRange(std::string &cname)
Definition: Table.cpp:2451
void SetTimeParsing(bool f)
Definition: Table.h:306
void SetDBPort(const char *p)
Definition: Table.h:88
std::string Folder()
Definition: Table.h:321
bool RemoveOrderColumn(const char *col)
Definition: Table.h:171
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
std::string fValiditySQL
Definition: Table.h:378
uint64_t fMinChannel
Definition: Table.h:365
void SetTag(std::string s)
Definition: Table.h:277
bool fHasRecordTime
Definition: Table.h:352
void SetTolerance(std::string &cname, float t)
Definition: Table.cpp:619
bool SetValidityRange(std::string cname, T start, T end)
Definition: Table.h:218
bool fHasConnection
Definition: Table.h:351
void SetRecordTime(double t)
Definition: Table.cpp:450
void SetSchema(std::string s)
Definition: Table.h:214
void SetDBName(std::string dbname)
Definition: Table.h:83
std::vector< std::string > GetColNames()
Definition: Table.cpp:608
void ClearRows()
Definition: Table.h:112
void SetQEURL(std::string url)
Definition: Table.h:303
bool TimeQueries()
Definition: Table.h:307
void SetDBHost(std::string dbhost)
Definition: Table.h:85
void ClearExcludedCols()
Definition: Table.h:181
void ClearPassword()
Definition: Table.h:95
nutools::dbi::Row *const NewRow()
Definition: Table.h:126
bool LoadConditionsTable()
Definition: Table.cpp:1880
std::string fPassword
Definition: Table.h:377
void AddExcludeCol(std::string col)
Definition: Table.h:180
bool SetRole(std::string role)
Definition: Table.cpp:852
Int_t col[ntarg]
Definition: Style.C:29
std::string GetTag()
Definition: Table.h:278
void AddRow(const Row *row)
Definition: Table.cpp:356
float Tolerance(std::string &cname)
Definition: Table.cpp:632
std::string fRole
Definition: Table.h:370
std::vector< uint64_t > fChannelVec
Definition: Table.h:398
double fRecordTime
Definition: Table.h:407
bool Write(bool commit=true)
Definition: Table.cpp:2356
void AddEmptyRows(unsigned int nrow)
Definition: Table.cpp:378
void SetMaxTSVld(double t)
Definition: Table.h:272
bool SetDetector(std::string det)
Definition: Table.cpp:500
int TableType()
Definition: Table.h:65
void SetTableName(std::string tname)
Definition: Table.cpp:524
std::string Type() const
Definition: ColumnDef.h:22
double fMaxTSVld
Definition: Table.h:405
short fVerbosity
Definition: Table.h:357
void SetDBInfo(std::string name, std::string host, std::string port, std::string user)
Definition: Table.cpp:557
std::string fDBHost
Definition: Table.h:372
bool RemoveDistinctColumn(unsigned int i)
Definition: Table.cpp:2482
pg_result PGresult
Definition: Table.h:19
std::string Name() const
Definition: ColumnDef.h:21
bool AddDistinctColumn(unsigned int i)
Definition: Table.cpp:2465
const nutools::dbi::ColumnDef * GetCol(const char *cname)
Definition: Table.h:135
std::string fSchema
Definition: Table.h:374
bool LoadUnstructuredConditionsTable()
Definition: Table.cpp:1850
std::string fWSURL
Definition: Table.h:383
int AddCol(std::string cname, std::string ctype)
Definition: Table.cpp:333
void SetConnectionTimeout(int n)
Definition: Table.h:263
bool GetDetector(std::string &det) const
Definition: Table.cpp:515
void SetDBPort(std::string p)
Definition: Table.h:87
void * Dataset
Definition: DBFolder.h:12
bool Tag(std::string tn="", bool override=false)
Definition: Table.cpp:2053
friend std::ostream & operator<<(std::ostream &stream, const Table &t)
Definition: Table.h:414
bool GetCurrSeqVal(std::string col, long &iseq)
Definition: Table.cpp:970
void SetSelectLimit(int limit)
Definition: Table.h:174
std::string User()
Definition: Table.h:62
const nutools::dbi::ColumnDef * GetPKeyCol(int i)
Definition: Table.h:190
bool addInsertUser
Definition: Table.h:342
void PrintPQErrorMsg() const
Definition: Table.cpp:493
void SetMinTSVld(double t)
Definition: Table.h:271
bool addUpdateTime
Definition: Table.h:343
int GetColIndex(std::string cname)
Definition: Table.cpp:589
void SetOrderDesc()
Definition: Table.h:177
std::string Role()
Definition: Table.h:63
void SetFolder(std::string f)
Definition: Table.h:320
bool fValidityChanged
Definition: Table.h:346
nutools::dbi::Row *const GetRow(int i)
Definition: Table.cpp:413
bool fTestedExists
Definition: Table.h:349
void SetMaxChannel(uint64_t chan)
Definition: Table.h:311
pg_conn PGconn
Definition: Table.h:17
Char_t n[5]
std::vector< uint64_t > VldChannels()
Definition: Table.h:288
void SetVerbosity(int i)
Definition: Table.h:100
bool GetColsFromDB(std::vector< std::string > pkeyList={})
Definition: Table.cpp:245
std::string fDBCacheFile
Definition: Table.h:376
nutools::dbi::Row * GetVldRow(uint64_t channel, double t)
Definition: Table.cpp:2035
std::string fTag
Definition: Table.h:382
bool GetCurrSeqVal(const char *col, long &iseq)
Definition: Table.h:184
int NVldRows(uint64_t channel)
Definition: Table.h:286
bool SetTableType(int t)
Definition: Table.cpp:458
std::string GetPassword()
Definition: Table.cpp:2606
void SetUser(std::string uname)
Definition: Table.h:79
std::string fDBPort
Definition: Table.h:371
std::vector< std::pair< int, int > > fNullList
Definition: Table.h:395
int DataTypeMask()
Definition: Table.h:67
bool WriteToDB(bool commit=true)
use commit=false if just testing
Definition: Table.cpp:2075
std::string fTableName
Definition: Table.h:368
std::string fDetector
Definition: Table.h:379
std::vector< nutools::dbi::Row > fRow
Definition: Table.h:388
std::string DBName()
Definition: Table.h:60
std::vector< nutools::dbi::ColumnDef > fValidityEnd
Definition: Table.h:391
int ParseSelfStatusLine(char *line)
Definition: Table.cpp:1522
std::string fDBName
Definition: Table.h:373
bool WriteToCSV(std::string fname, bool appendToFile=false, bool writeColNames=false)
Definition: Table.cpp:2412
std::unordered_map< uint64_t, std::vector< nutools::dbi::Row * > > fChanRowMap
Definition: Table.h:399
bool RemoveDistinctColumn(const char *col)
Definition: Table.h:162
void SetDataTypeMask(int mask)
Definition: Table.h:76
std::string tableName
std::string fUConDBURL
Definition: Table.h:384
bool GetDataFromWebService(Dataset &, std::string)
Definition: Table.cpp:1572
std::vector< const nutools::dbi::ColumnDef * > fDistinctCol
Definition: Table.h:393