274   : 
TFile(), fSQL(0), fSQLClassInfos(0), fUseSuffixes(
kTRUE), fSQLIOversion(1), fArrayLimit(21),
 
  275     fCanChangeConfig(
kFALSE), fTablesType(), fUseTransactions(0), fUseIndexes(0), fModifyCounter(0), fQuerisCounter(0),
 
  276     fBasicTypes(0), fOtherTypes(0), fUserName(), fLogFile(0), fIdsTableExists(
kFALSE), fStmtCounter(0)
 
  300   : 
TFile(), fSQL(0), fSQLClassInfos(0), fUseSuffixes(
kTRUE), fSQLIOversion(1), fArrayLimit(21),
 
  301     fCanChangeConfig(
kFALSE), fTablesType(), fUseTransactions(0), fUseIndexes(0), fModifyCounter(0), fQuerisCounter(0),
 
  303     fIdsTableExists(
kFALSE), fStmtCounter(0)
 
  306      ::Fatal(
"TFile::TFile", 
"ROOT system not initialized");
 
  310   SetTitle(
"TFile interface to SQL DB");
 
  314   if (dbname && strstr(dbname, 
"oracle://") != 0) {
 
  362   if (!create && !recreate && !
update && !read) {
 
  367   if (!dbname || !dbname[0]) {
 
  368      Error(
"TSQLFile", 
"Database not specified");
 
  377      Error(
"TSQLFile", 
"Cannot connect to DB %s", dbname);
 
  384            Error(
"TSQLFile", 
"no write permission, DB %s locked", dbname);
 
  394      Error(
"TSQLFile", 
"DB tables already exists");
 
  405         Error(
"TSQLFile", 
"no write permission, DB %s locked", dbname);
 
  412         Error(
"TSQLFile", 
"DB %s tables not exist", dbname);
 
  416         Error(
"TSQLFile", 
"no read permission for DB %s tables", dbname);
 
  453   fLogFile = 
new std::ofstream(fname);
 
  504      Error(
"SetUseSuffixes", 
"Configurations already cannot be changed");
 
  520      Error(
"SetArrayLimit", 
"Configurations already cannot be changed");
 
  534      Error(
"SetTablesType", 
"Configurations already cannot be changed");
 
  571      Error(
"SQLStartTransaction", 
"Only allowed when SetUseTransactions(kUserTransactions) was configured");
 
  585      Error(
"SQLCommit", 
"Only allowed when SetUseTransactions(kUserTransactions) was configured");
 
  599      Error(
"SQLRollback", 
"Only allowed when SetUseTransactions(kUserTransactions) was configured");
 
  621      Error(
"SetUseIndexes", 
"Configurations already cannot be changed");
 
  686   gROOT->GetListOfFiles()->Remove(
this);
 
  715   return fSQL != 
nullptr;
 
  729   if (opt != 
"READ" && opt != 
"UPDATE") {
 
  730      Error(
"ReOpen", 
"mode must be either READ or UPDATE, not %s", opt.
Data());
 
  752         Error(
"ReOpen", 
"Tables are locked, no write access");
 
  802      Info(
"WriteStreamerInfo", 
"Saving streamer infos to database");
 
  814            Info(
"WriteStreamerInfo", 
"Add %s", info->
GetName());
 
  890      Info(
"GetStreamerInfoList", 
"Start reading of streamer infos");
 
  899      return {
nullptr, 1, hash};
 
  902   return {list, 0, hash};
 
  935   if (specialkeyid >= 0) {
 
  950   while ((row = res->
Next()) != 
nullptr) {
 
  956      const char *keyname = (*row)[3];
 
  957      const char *keytitle = (*row)[4];
 
  958      const char *keydatime = (*row)[5];
 
  959      Int_t cycle = atoi((*row)[6]);
 
  960      const char *classname = (*row)[7];
 
  963         std::cout << 
"  Reading keyid = " << keyid << 
" name = " << keyname << std::endl;
 
  970               Error(
"StreamKeysForDirectory", 
"Key with id %lld not exist in list", keyid);
 
  972            } 
else if (key->
IsKeyModified(keyname, keytitle, keydatime, cycle, classname))
 
  976            TKeySQL *key = 
new TKeySQL(dir, keyid, objid, keyname, keytitle, keydatime, cycle, classname);
 
  990      Info(
"StreamKeysForDirectory", 
"dir = %s numread = %d", dir->
GetName(), nkeys);
 
 1003   Int_t len = 
gROOT->GetListOfStreamerInfo()->GetSize() + 1;
 
 1027         Error(
"InitSqlDatabase", 
"Cannot detect proper tabled in database. Close.");
 
 1039      gROOT->GetListOfFiles()->Add(
this);
 
 1044   TKey *key = 
nullptr;
 
 1046   while ((key = (
TKey *)iter()) != 
nullptr) {
 
 1073#define ReadIntCfg(name, target)                           \ 
 1074   if ((field.CompareTo(name, TString::kIgnoreCase) == 0)) \ 
 1075      target = value.Atoi();                               \ 
 1078#define ReadBoolCfg(name, target)                                       \ 
 1079   if ((field.CompareTo(name, TString::kIgnoreCase) == 0))              \ 
 1080      target = value.CompareTo(sqlio::True, TString::kIgnoreCase) == 0; \ 
 1083#define ReadStrCfg(name, target)                           \ 
 1084   if ((field.CompareTo(name, TString::kIgnoreCase) == 0)) \ 
 1090   while ((row = res->
Next()) != 
nullptr) {
 
 1102         Error(
"ReadConfigurations", 
"Invalid configuration field %s", field.
Data());
 
 1134      sqlcmd += 
" ENGINE=";
 
 1140#define WrintCfg(name, type, value)                                                                                   \ 
 1142      sqlcmd.Form("INSERT INTO %s%s%s VALUES (%s%s%s, %s" type "%s)", quote, sqlio::ConfigTable, quote, vquote, name, \
 
 1143                  vquote, vquote, value, vquote);                                                                     \
 
 1144      SQLQuery(sqlcmd.Data());                                                                                        \
 
 1165      "CREATE TABLE %s%s%s (%s%s%s %s, %s%s%s %s, %s%s%s %s, %s%s%s %s, %s%s%s %s, %s%s%s %s, %s%s%s %s, %s%s%s %s)",
 
 1166      quote, 
sqlio::KeysTable, quote, quote, 
SQLKeyIdColumn(), quote, 
SQLIntType(), quote, 
SQLDirIdColumn(), quote,
 
 1172      sqlcmd += 
" ENGINE=";
 
 1194      Error(
"IncrementModifyCounter", 
"Cannot update tables without write accsess");
 
 1231   res.
Form(
"SELECT %s FROM %s", columns.
Data(), tables.
Data());
 
 1243   if (!info || !sqlinfo)
 
 1252   table_syn.
Form(
"t%d", ++tablecnt);
 
 1293         buf.
Form(
", %s.%s%s%s", table_syn.
Data(), quote, colname.
Data(), quote);
 
 1307            buf.
Form(
", %s.%s%s%s", table_syn.
Data(), quote, colname.
Data(), quote);
 
 1315   return (columns.
Length() > 0) && (tables.
Length() > 0);
 
 1357   sqlcmd.
Form(
"SELECT %s%s%s FROM %s%s%s WHERE %s%s%s=%s%s%s", quote, 
sqlio::CT_Value, quote, quote,
 
 1369   return field.
Atoi();
 
 1404      Info(
"SQLQuery", 
"%s", cmd);
 
 1451      Info(
"SQLStatement", 
"%s", cmd);
 
 1484   while ((cmd = iter()) != 
nullptr) {
 
 1522      Info(
"SQLMaximumValue", 
"Requests for %s column %s", tablename, columnname);
 
 1527   query.
Form(
"SELECT MAX(%s%s%s) FROM %s%s%s", quote, columnname, quote, quote, tablename, quote);
 
 1544      Info(
"SQLMaximumValue", 
"Result = %lld", maxid);
 
 1566   while ((obj = iter()) != 
nullptr) {
 
 1567      sqlcmd.
Form(
"DROP TABLE %s%s%s", quote, obj->
GetName(), quote);
 
 1623   sqlcmd.
Form(
"SELECT MIN(%s%s%s), MAX(%s%s%s) FROM %s%s%s WHERE %s%s%s=%lld", quote, 
SQLObjectIdColumn(), quote,
 
 1639   if (minid <= maxid) {
 
 1643      querymask.
Form(
"DELETE FROM %s%s%s WHERE %s%s%s BETWEEN %lld AND %lld", quote, 
"%s", quote, quote,
 
 1682   while ((obj = next()) != 
nullptr) {
 
 1706   sqlcmd.
Form(
"INSERT INTO %s%s%s VALUES (%lld, %lld, %lld, %s%s%s, %s%s%s, %s%s%s, %d, %s%s%s)", quote,
 
 1742   sqlcmd.
Form(
"UPDATE %s%s%s SET %s%s%s=%s, %s%s%s=%s, %s%s%s=%s, %s%s%s=%d WHERE %s%s%s=%lld", quote,
 
 1785      if (strcmp(info->
GetName(), clname) == 0)
 
 1843   const char *suffix = rawtable ? 
"_raw" : 
"_ver";
 
 1845   res.
Form(
"%s%s%d", clname, suffix, version);
 
 1852   Int_t len = strlen(clname);
 
 1858      scnt.
Form(
"%d%s", 
cnt, suffix);
 
 1860      if (numlen >= maxlen - 2)
 
 1865      if (len + numlen > maxlen)
 
 1866         res.
Resize(maxlen - numlen);
 
 1875   } 
while (
cnt < 10000);
 
 1877   Error(
"DefineTableName", 
"Cannot produce table name for class %s ver %d", clname, version);
 
 1878   res.
Form(
"%s%s%d", clname, suffix, version);
 
 1927   sqlcmd.
Form(
"SELECT * FROM %s%s%s WHERE %s%s%s = %d ORDER BY %s%s%s", quote, 
sqlio::IdsTable, quote, quote,
 
 1935      while ((row = res->
Next()) != 
nullptr) {
 
 1939         const char *classname = row->
GetField(3);
 
 1940         const char *classtable = row->
GetField(4);
 
 1957      sqlcmd.
Form(
"SELECT * FROM %s%s%s WHERE %s%s%s = %lld ORDER BY %s%s%s", quote, 
sqlio::IdsTable, quote, quote,
 
 1964         while ((row = res->
Next()) != 
nullptr) {
 
 1968            const char *fullname = row->
GetField(3);
 
 1969            const char *sqlname = row->
GetField(4);
 
 1970            const char *info2 = row->
GetField(5);
 
 1986   sqlcmd.
Form(
"SELECT * FROM %s%s%s WHERE %s%s%s = %d ORDER BY %s%s%s", quote, 
sqlio::IdsTable, quote, quote,
 
 1992      while ((row = res->
Next()) != 
nullptr) {
 
 1996         const char *classname = row->
GetField(3);
 
 1997         const char *rawtable = row->
GetField(4);
 
 2038      sqlcmd.
Form(
"CREATE TABLE %s%s%s (%s%s%s %s, %s%s%s %s, %s%s%s %s, %s%s%s %s, %s%s%s %s, %s%s%s %s)", quote,
 
 2044         sqlcmd += 
" ENGINE=";
 
 2052   sqlcmd.
Form(
"INSERT INTO %s%s%s VALUES (%lld, %d, %d, %s%s%s, %s%s%s, %s%s%s)", quote, 
sqlio::IdsTable, quote,
 
 2053               tableid, subid, 
type, valuequote, 
name, valuequote, valuequote, sqlname, valuequote, valuequote, info,
 
 2081      Info(
"CreateClassTable", 
"cl:%s", sqlinfo->
GetName());
 
 2091   TIter iter(colinfos);
 
 2103      if ((strpbrk(colname, 
"[:.]<>") != 0) || forcequote) {
 
 2109         sqlcmd += colname, sqlcmd += 
" ";
 
 2120      sqlcmd += 
" ENGINE=";
 
 2133      sqlcmd.
Form(
"CREATE UNIQUE INDEX %s%s_I1%s ON %s%s%s (%s%s%s)", quote, indxname.
Data(), quote, quote,
 
 2159   sqlcmd.
Form(
"CREATE TABLE %s%s%s (%s%s%s %s, %s%s%s %s, %s %s, %s %s)", quote, sqlinfo->
GetRawTableName(), quote,
 
 2164      sqlcmd += 
" ENGINE=";
 
 2175      sqlcmd.
Form(
"CREATE UNIQUE INDEX %s%s_I2%s ON %s%s%s (%s%s%s, %s%s%s)", quote, indxname.
Data(), quote, quote,
 
 2205      sqlcmd += 
" ENGINE=";
 
 2238   if (*value++ != 
' ')
 
 2241   if ((*value < 
'1') || (*value > 
'9'))
 
 2244      s_objid.
Append(*value++);
 
 2245   } 
while ((*value != 0) && (*value >= 
'0') && (*value <= 
'9'));
 
 2247   if (*value++ != 
' ')
 
 2252   if (*value++ != 
' ')
 
 2255   if ((*value < 
'1') || (*value > 
'9'))
 
 2258      s_strid.
Append(*value++);
 
 2259   } 
while ((*value != 0) && (*value >= 
'0') && (*value <= 
'9'));
 
 2260   if (*value++ != 
' ')
 
 2267   if (objid2 != objid)
 
 2270   return atoi(s_strid.
Data());
 
 2316      Info(
"VerifyObjectTable", 
"Checks if object table is there");
 
 2323      sqlcmd.
Form(
"CREATE TABLE %s%s%s (%s%s%s %s, %s%s%s %s, %s%s%s %s, %s%s%s %s)", quote, 
sqlio::ObjectsTable, quote,
 
 2328         sqlcmd += 
" ENGINE=";
 
 2354   sqlcmd.
Form(
"SELECT %s%s%s, %s%s%s FROM %s%s%s WHERE %s%s%s=%lld", quote, 
sqlio::OT_Class, quote, quote,
 
 2367   return row != 
nullptr;
 
 2381   sqlcmd.
Form(
"SELECT %s%s%s, %s%s%s, %s%s%s FROM %s%s%s WHERE %s%s%s=%lld ORDER BY %s%s%s", quote,
 
 2390      Info(
"SQLObjectsInfo", 
"%s", sqlcmd.
Data());
 
 2401         const char *clname = stmt->
GetString(1);
 
 2419   while ((row = res->
Next()) != 
nullptr) {
 
 2421      const char *clname = row->
GetField(1);
 
 2444   sqlcmd.
Form(
"SELECT * FROM %s%s%s WHERE %s%s%s=%lld", quote, sqlinfo->
GetClassTableName(), quote, quote,
 
 2458   sqlcmd.
Form(
"SELECT * FROM %s%s%s WHERE %s%s%s BETWEEN %lld AND %lld ORDER BY %s%s%s", quote,
 
 2497      Info(
"BuildStatement", 
"%s", sqlcmd.
Data());
 
 2532      Error(
"StoreObjectInTables", 
"Cannot convert object data to TSQLStructure");
 
 2538      if (
s && !
s->ConvertToTables(
this, keyid, &cmds)) {
 
 2539         Error(
"StoreObjectInTables", 
"Cannot convert to SQL statements");
 
 2550            Error(
"StoreObject", 
"Cannot correctly store object data in database");
 
 2571   return (typ < 0) || (typ > 18) ? 0 : 
fBasicTypes[typ];
 
 2650   TString col1name = 
"CreateTime";
 
 2651   TString col2name = 
"ModifyTime";
 
 2659   sqlcmd.
Form(
"UPDATE %s%s%s SET %s%s%s=%s, %s%s%s=%s, %s%s%s=%s WHERE %s%s%s=%lld", quote,
 
 2675   if (
b.IsReading()) {
 
 2679      b.ClassMember(
"CreateTime", 
"TString");
 
 2684      b.ClassMember(
"ModifyTime", 
"TString");
 
 2689      b.ClassMember(
"UUID", 
"TString");
 
 2701      b.ClassMember(
"CreateTime", 
"TString");
 
 2706      b.ClassMember(
"ModifyTime", 
"TString");
 
 2711      b.ClassMember(
"UUID", 
"TString");
 
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
 
R__EXTERN TVirtualMutex * gROOTMutex
 
const char * mysql_OtherTypes[13]
 
const char * oracle_BasicTypes[21]
 
#define ReadStrCfg(name, target)
 
#define ReadBoolCfg(name, target)
 
#define ReadIntCfg(name, target)
 
const char * mysql_BasicTypes[21]
 
#define WrintCfg(name, type, value)
 
const char * oracle_OtherTypes[13]
 
typedef void((*Func_t)())
 
#define R__LOCKGUARD(mutex)
 
Array of chars or bytes (8 bits per element).
 
void InitMap() override
Create the fMap container and initialize them with the null object.
 
Converts data to SQL statements or read data from SQL tables.
 
Int_t GetErrorFlag() const
 
TSQLStructure * SqlWriteAny(const void *obj, const TClass *cl, Long64_t objid)
Convert object of any class to sql structures Return pointer on created TSQLStructure TSQLStructure o...
 
void * SqlReadAny(Long64_t keyid, Long64_t objid, TClass **cl, void *obj=nullptr)
Recreate object from sql structure.
 
Buffer base class used for serializing objects.
 
TClass instances represent classes, structs and namespaces in the ROOT type system.
 
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
 
Version_t GetClassVersion() const
 
virtual void Print(Option_t *option="") const
Default print for collections, calls Print(option, 1).
 
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
 
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
 
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
 
void Set()
Set Date/Time to current time as reported by the system.
 
A ROOT file is structured in Directories (like a file system).
 
void Close(Option_t *option="") override
Delete all objects from memory and directory structure itself.
 
TFile * fFile
Pointer to current file in memory.
 
Bool_t IsWritable() const override
 
TDatime fDatimeM
Date and time of last modification.
 
const TDatime & GetCreationDate() const
 
Bool_t cd(const char *path=nullptr) override
Change current directory to "this" directory.
 
const TDatime & GetModificationDate() const
 
Long64_t fSeekDir
Location of directory on file.
 
TDatime fDatimeC
Date and time when directory is created.
 
Bool_t fWritable
True if directory is writable.
 
void SetWritable(Bool_t writable=kTRUE) override
Set the new value of fWritable recursively.
 
void Build(TFile *motherFile=nullptr, TDirectory *motherDir=nullptr) override
 
TList * fKeys
Pointer to keys list in memory.
 
Small helper to keep current directory context.
 
Describe directory structure in memory.
 
virtual Long64_t GetSeekDir() const
 
void SetName(const char *newname) override
Set the name for directory If the directory name is changed after the directory was written once,...
 
virtual TList * GetListOfKeys() const
 
TDirectory * GetMotherDir() const
 
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
 
Long64_t fBytesRead
Number of bytes read from this file.
 
Double_t fSum2Buffer
Sum of squares of buffer sizes of objects written so far.
 
virtual void ReadStreamerInfo()
Read the list of StreamerInfo from this file.
 
TArrayC * fClassIndex
!Index of TStreamerInfo classes written to this file
 
Long64_t fSeekInfo
Location on disk of StreamerInfo record.
 
virtual void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
See comments for function SetCompressionSettings.
 
Int_t fVersion
File format version.
 
Int_t fNbytesInfo
Number of bytes for StreamerInfo record.
 
TString fOption
File options.
 
Char_t fUnits
Number of bytes for file pointers.
 
TObjArray * fProcessIDs
!Array of pointers to TProcessIDs
 
Long64_t fBytesWrite
Number of bytes written to this file.
 
TList * fFree
Free segments linked list table.
 
TString fRealName
Effective real file name (not original url)
 
Double_t fSumBuffer
Sum of buffer sizes of objects written so far.
 
Int_t fNProcessIDs
Number of TProcessID written to this file.
 
Int_t fWritten
Number of objects written so far.
 
TKeySQL represents meta-information about object, which was written to SQL database.
 
Bool_t IsKeyModified(const char *keyname, const char *keytitle, const char *keydatime, Int_t cycle, const char *classname)
Compares keydata with provided and return kTRUE if key was modified Used in TFile::StreamKeysForDirec...
 
Long64_t GetDBKeyId() const
 
Long64_t GetDBDirId() const
return sql id of parent directory
 
Long64_t GetDBObjId() const
 
Book space in a file, create I/O buffers, to fill them, (un)compress them.
 
virtual const char * GetClassName() const
 
virtual const char * GetTitle() const
Returns title (title can contain 32x32 xpm thumbnail/icon).
 
const TDatime & GetDatime() const
 
Short_t GetCycle() const
Return cycle number associated to this key.
 
virtual void Add(TObject *obj)
 
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
 
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
 
virtual const char * GetTitle() const
Returns title of object.
 
virtual const char * GetName() const
Returns name of object.
 
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
 
Mother of all ROOT objects.
 
virtual const char * GetName() const
Returns name of object.
 
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
 
virtual const char * ClassName() const
Returns name of class to which the object belongs.
 
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
 
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
 
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
 
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
 
A TProcessID identifies a ROOT job in a unique way in time and space.
 
virtual void Clear(Option_t *option="")
delete the TObjArray pointing to referenced objects this function is called by TFile::Close("R")
 
static TProcessID * GetSessionProcessID()
static function returning the pointer to the session TProcessID
 
Int_t DecrementCount()
The reference fCount is used to delete the TProcessID in the TFile destructor when fCount = 0.
 
const char * GetSQLName() const
 
const char * GetSQLType() const
 
const char * GetName() const final
Returns name of object.
 
Contains information about tables specific to one class and version.
 
Bool_t IsClassTableExist() const
 
void SetRawTableName(const char *name)
 
void SetRawExist(Bool_t on)
 
void SetClassTableName(const char *name)
 
Int_t GetClassVersion() const
 
const char * GetName() const final
Returns name of object.
 
Long64_t GetClassId() const
 
const char * GetClassTableName() const
 
const char * GetRawTableName() const
 
void SetColumns(TObjArray *columns)
assigns new list of columns
 
Bool_t IsRawTableExist() const
 
Access an SQL db via the TFile interface.
 
Bool_t CreateClassTable(TSQLClassInfo *sqlinfo, TObjArray *colinfos)
Create normal class table if required.
 
TString MakeSelectQuery(TClass *cl)
Produce SELECT statement which can be used to get all data of class cl in one SELECT statement.
 
const char * SQLIdentifierQuote() const
 
Int_t DirReadKeys(TDirectory *) final
Read directory list of keys from database.
 
Long64_t VerifyObjectTable()
Checks that objects table is exists If not, table will be created Returns maximum value for existing ...
 
TSQLResult * GetNormalClassData(Long64_t objid, TSQLClassInfo *sqlinfo)
Method return request result for specified objid from normal classtable.
 
TObject * ReadSpecialObject(Long64_t keyid, TObject *obj=0)
Read data of special kind of objects.
 
TSQLFile()
default TSQLFile constructor
 
Bool_t WriteSpecialObject(Long64_t keyid, TObject *obj, const char *name, const char *title)
write special kind of object like streamer infos or file itself keys for that objects should exist in...
 
void StartLogFile(const char *fname)
start logging of all SQL statements in specified file
 
Bool_t fUseSuffixes
! use suffixes in column names like fValue:Int_t or fObject:pointer
 
void AddIdEntry(Long64_t tableid, Int_t subid, Int_t type, const char *name, const char *sqlname, const char *info)
Add entry into IdsTable, where all tables names and columns names are listed.
 
TKey * CreateKey(TDirectory *mother, const TObject *obj, const char *name, Int_t bufsize) final
create SQL key, which will store object in data base
 
Bool_t ReadConfigurations()
read table configurations as special table
 
Int_t IsLongStringCode(Long64_t objid, const char *value)
Checks if this is long string code returns 0, if not or string id.
 
void CreateBasicTables()
Creates initial tables in database This is table with configurations and table with keys Function cal...
 
Int_t GetUseTransactions() const
 
void WriteHeader() final
Write file info like configurations, title, UUID and other.
 
TSQLClassInfo * FindSQLClassInfo(const char *clname, Int_t version)
Return (if exists) TSQLClassInfo for specified class name and version.
 
const char * SQLDatetimeType() const
 
void ReadSQLClassInfos()
Read all class infos from IdsTable.
 
Bool_t Commit()
Commit transaction, started by StartTransaction() call.
 
void IncrementModifyCounter()
Update value of modify counter in config table Modify counter used to indicate that something was cha...
 
Int_t fArrayLimit
! limit for array size. when array bigger, its content converted to raw format
 
void SetLocking(Int_t mode)
Set locking mode for current database.
 
Int_t ReOpen(Option_t *mode) final
Reopen a file with a different access mode, like from READ to See TFile::Open() for details.
 
Bool_t SQLRollback()
Rollback all SQL operations, done after start transaction.
 
TObjArray * SQLObjectsInfo(Long64_t keyid)
Produce array of TSQLObjectInfo objects for all objects, belong to that key Array should be deleted b...
 
Bool_t GetUseSuffixes() const
 
Bool_t SQLCanStatement()
Test if DB support statement and number of open statements is not exceeded.
 
Bool_t CreateRawTable(TSQLClassInfo *sqlinfo)
Create the raw table.
 
Long64_t StoreObjectInTables(Long64_t keyid, const void *obj, const TClass *cl)
Store object in database. Return stored object id or -1 if error.
 
void InitSqlDatabase(Bool_t create)
initialize sql database and correspondent structures identical to TFile::Init() function
 
const char * SQLStrIdColumn() const
 
Bool_t IsOpen() const final
return kTRUE if file is opened and can be accessed
 
Bool_t SQLObjectInfo(Long64_t objid, TString &clname, Version_t &version)
Read from objects table data for specified objectid.
 
Int_t fQuerisCounter
! how many query was applied
 
const char * SQLValueQuote() const
 
const char * SQLBigTextType() const
 
Int_t GetLocking()
Return current locking mode for that file.
 
Bool_t HasTable(const char *name)
Test if table name exists.
 
TKeySQL * FindSQLKey(TDirectory *dir, Long64_t keyid)
Search for TKeySQL object with specified keyid.
 
const char * SQLDefaultTableType() const
 
Bool_t Rollback()
Rollback all operations, done after StartTransaction() call.
 
Bool_t IsWriteAccess()
Checkis, if lock is free in configuration tables.
 
Bool_t IsMySQL() const
checks, if MySQL database
 
InfoListRet GetStreamerInfoListImpl(bool) final
Read back streamer infos from database List of streamer infos is always stored with key:id 0,...
 
void SQLDeleteAllTables()
Delete all tables in database.
 
Bool_t IsOracle() const
checks, if Oracle database
 
Int_t StreamKeysForDirectory(TDirectory *dir, Bool_t doupdate, Long64_t specialkeyid=-1, TKeySQL **specialkey=0)
read keys for specified directory (when update == kFALSE) or update value for modified keys when upda...
 
void SetTablesType(const char *table_type)
Defines tables type, which is used in CREATE TABLE statements Now is only used for MySQL database,...
 
const char * SQLKeyIdColumn() const
 
Bool_t WriteKeyData(TKeySQL *key)
Add entry into keys table.
 
void SetUseTransactions(Int_t mode=kTransactionsAuto)
Defines usage of transactions statements for writing objects data to database.
 
Int_t fStmtCounter
! count numbers of active statements
 
Bool_t fCanChangeConfig
! variable indicates can be basic configuration changed or not
 
TString CodeLongString(Long64_t objid, Int_t strid)
Produces id which will be placed in column instead of string itself.
 
const char * SQLObjectIdColumn() const
 
virtual ~TSQLFile()
destructor of TSQLFile object
 
const char ** fOtherTypes
! pointer on list of other SQL types like TEXT or blob
 
Bool_t fIdsTableExists
! indicate if IdsTable exists
 
TSQLStatement * GetBlobClassDataStmt(Long64_t objid, TSQLClassInfo *sqlinfo)
Method return request results for specified objid from streamer classtable Data returned in form of s...
 
TSQLResult * GetBlobClassData(Long64_t objid, TSQLClassInfo *sqlinfo)
Method return request results for specified objid from streamer classtable.
 
void DeleteKeyFromDB(Long64_t keyid)
Remove key with specified id from keys table also removes all objects data, related to this table.
 
void Close(Option_t *option="") final
Close a SQL file For more comments see TFile::Close() function.
 
Bool_t SQLTestTable(const char *tablename)
Test, if table of specified name exists.
 
const char * SQLIntType() const
return SQL integer type
 
TSQLStatement * SQLStatement(const char *cmd, Int_t bufsize=1000)
Produces SQL statement for currently conected DB server.
 
void SQLDeleteStatement(TSQLStatement *stmt)
delete statement and decrease counter
 
TSQLResult * SQLQuery(const char *cmd, Int_t flag=0, Bool_t *res=0)
Submits query to SQL server.
 
TList * fSQLClassInfos
! list of SQL class infos
 
void DirWriteKeys(TDirectory *) final
Write directory keys list to database.
 
std::ofstream * fLogFile
! log file with SQL statements
 
Long64_t DefineNextKeyId()
Returns next possible key identifier.
 
TSQLResult * GetNormalClassDataAll(Long64_t minobjid, Long64_t maxobjid, TSQLClassInfo *sqlinfo)
Return data for several objects from the range from normal class table.
 
Int_t GetUseIndexes() const
 
void WriteStreamerInfo() final
Store all TVirtualStreamerInfo, used in file, in sql database.
 
void SaveToDatabase()
save data which is not yet in Database Typically this is streamerinfos structures or
 
Bool_t SQLApplyCommands(TObjArray *cmds)
supplies set of commands to server Commands is stored as array of TObjString
 
const char ** fBasicTypes
! pointer on list of basic types specific for currently connected SQL server
 
Long64_t DirCreateEntry(TDirectory *) final
Create entry for directory in database.
 
Bool_t IsReadAccess()
dummy, in future should check about read access to database
 
Int_t SQLMaxIdentifierLength()
returns maximum allowed length of identifiers
 
Bool_t GetLongString(Long64_t objid, Int_t strid, TString &value)
Returns value of string, extracted from special table, where long strings are stored.
 
Bool_t ProduceClassSelectQuery(TVirtualStreamerInfo *info, TSQLClassInfo *sqlinfo, TString &columns, TString &tables, Int_t &tablecnt)
used by MakeClassSelectQuery method to add columns from table of class, specified by TVirtualStreamer...
 
Bool_t SQLCommit()
Commit SQL transaction.
 
const char * SQLRawIdColumn() const
 
Bool_t UpdateKeyData(TKeySQL *key)
Updates (overwrites) key data in KeysTable.
 
Int_t fUseIndexes
! use indexes for tables: 0 - off, 1 - only for basic tables, 2 + normal class tables,...
 
const char * GetDataBaseName() const
Return name of data base on the host For Oracle always return 0.
 
void SetUseSuffixes(Bool_t on=kTRUE)
enable/disable uasge of suffixes in columns names can be changed before first object is saved into fi...
 
Int_t fUseTransactions
! use transaction statements for writing data into the tables
 
TString DefineTableName(const char *clname, Int_t version, Bool_t rawtable)
Proposes table name for class.
 
Bool_t IsTablesExists()
Checks if main keys table is existing.
 
void StopLogFile()
close logging file
 
void SetArrayLimit(Int_t limit=20)
Defines maximum number of columns for array representation If array size bigger than limit,...
 
Long64_t SQLMaximumValue(const char *tablename, const char *columnname)
Returns maximum value, found in specified columnname of table tablename Column type should be numeric...
 
TSQLServer * fSQL
! interface to SQL database
 
TString fTablesType
! type, used in CREATE TABLE statements
 
TSQLClassInfo * RequestSQLClassInfo(const char *clname, Int_t version)
Search in database tables for specified class and return TSQLClassInfo object.
 
Bool_t IsODBC() const
checks, if ODBC driver used for database connection
 
void DirWriteHeader(TDirectory *) final
Update dir header in the file.
 
Int_t fModifyCounter
! indicates how many changes was done with database tables
 
const char * SQLDirIdColumn() const
 
Int_t fSQLIOversion
! version of SQL I/O which is stored in configurations
 
Bool_t StartTransaction()
Start user transaction.
 
const char * SQLSmallTextType() const
 
void SetUseIndexes(Int_t use_type=kIndexesBasic)
Specify usage of indexes for data tables.
 
const char * SQLCompatibleType(Int_t typ) const
Returns sql type name which is most closer to ROOT basic type.
 
Bool_t VerifyLongStringTable()
Checks that table for big strings is exists If not, will be created.
 
Bool_t SQLStartTransaction()
Start SQL transaction.
 
Info (classname, version) about object in database.
 
virtual TSQLRow * Next()=0
 
virtual const char * GetField(Int_t field)=0
 
virtual TList * GetTablesList(const char *wild=0)
Return list of user tables Parameter wild specifies wildcard for table names.
 
virtual Bool_t Commit()
submit "COMMIT" query to database return kTRUE, if successful
 
virtual Bool_t HasStatement() const
 
virtual Int_t GetMaxIdentifierLength()
 
virtual Bool_t HasTable(const char *tablename)
Tests if table of that name exists in database Return kTRUE, if table exists.
 
virtual Bool_t Exec(const char *sql)
Execute sql query.
 
virtual Bool_t Rollback()
submit "ROLLBACK" query to database return kTRUE, if successful
 
virtual Bool_t StartTransaction()
submit "START TRANSACTION" query to database return kTRUE, if successful
 
virtual TSQLResult * Query(const char *sql)=0
 
static TSQLServer * Connect(const char *db, const char *uid, const char *pw)
The db should be of the form: <dbms>://<host>[:<port>][/<database>], e.g.
 
virtual TSQLStatement * Statement(const char *, Int_t=100)
 
virtual const char * GetString(Int_t)
 
virtual Bool_t NextResultRow()=0
 
virtual Int_t GetInt(Int_t)
 
virtual Long64_t GetLong64(Int_t)
 
virtual Bool_t Process()=0
 
virtual Bool_t StoreResult()=0
 
This is hierarchical structure, which is created when data is written by TBufferSQL2.
 
static void AddStrBrackets(TString &s, const char *quote)
adds quotes around string value and replaces some special symbols
 
static Int_t DefineElementColumnType(TStreamerElement *elem, TSQLFile *f)
defines which kind of column can be assigned for this element Possible cases kColSimple - basic data ...
 
static TString DefineElementColumnName(TStreamerElement *elem, TSQLFile *f, Int_t indx=0)
returns name of the column in class table for that element
 
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
 
Int_t GetArrayLength() const
 
void ToLower()
Change string to lower-case.
 
Int_t Atoi() const
Return integer value of string.
 
const char * Data() const
 
TString & ReplaceAll(const TString &s1, const TString &s2)
 
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
 
void ToUpper()
Change string to upper case.
 
TString & Append(const char *cs)
 
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
 
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
 
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
 
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
 
Abstract Interface class describing Streamer information for one class.
 
virtual TObjArray * GetElements() const =0
 
virtual Int_t GetNumber() const =0
 
virtual TClass * GetClass() const =0
 
static constexpr double s
 
const char * cfg_UseIndexes
 
const char * StringsTable
 
const char * ObjectsTableIndex
 
const char * KeysTableIndex
 
Long64_t atol64(const char *value)
 
const char * cfg_TablesType
 
const Int_t Ids_StreamerInfos
 
const char * cfg_ArrayLimit
 
const char * TObjectProcessId
 
const char * cfg_UseTransactions
 
const char * cfg_LockingMode
 
const char * cfg_UseSufixes
 
const char * ObjectsTable
 
const char * cfg_ModifyCounter
 
const char * TObjectUniqueId
 
const char * LongStrPrefix
 
@ kUseCompiledDefault
Use the compile-time default setting.
 
Simple struct of the return value of GetStreamerInfoListImpl.