12#ifndef ROOT_TSQLServer
13#define ROOT_TSQLServer
55 void SetError(
Int_t code,
const char* msg,
const char *method =
nullptr);
#define ClassDef(name, id)
Mother of all ROOT objects.
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract.
virtual void EnableErrorOutput(Bool_t on=kTRUE)
virtual void Close(Option_t *option="")=0
const char * GetDB() const
virtual Int_t SelectDataBase(const char *dbname)=0
virtual Bool_t Commit()
submit "COMMIT" query to database return kTRUE, if successful
const char * GetHost() const
void ClearError()
reset error fields
virtual const char * GetErrorMsg() const
returns error message of last operation if no errors, return 0 Each specific implementation of TSQLSe...
const char * GetDBMS() const
virtual TSQLTableInfo * GetTableInfo(const char *tablename)
Produce TSQLTableInfo object, which contain info about table itself and each table column Object must...
void SetError(Int_t code, const char *msg, const char *method=nullptr)
set new values for error fields if method is specified, displays error message
virtual Int_t Shutdown()=0
virtual Int_t CreateDataBase(const char *dbname)=0
virtual Bool_t HasTransactionInFlight()
returns kTRUE when transaction is running Must be implemented in derived classes
virtual Bool_t HasStatement() const
virtual Int_t GetErrorCode() const
returns error code of last operation if res==0, no error Each specific implementation of TSQLServer p...
virtual Int_t GetMaxIdentifierLength()
virtual TSQLResult * GetColumns(const char *dbname, const char *table, const char *wild=nullptr)=0
virtual Bool_t HasTable(const char *tablename)
Tests if table of that name exists in database Return kTRUE, if table exists.
virtual TSQLResult * GetDataBases(const char *wild=nullptr)=0
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 PingVerify()
virtual Bool_t StartTransaction()
submit "START TRANSACTION" query to database return kTRUE, if successful
virtual TList * GetTablesList(const char *wild=nullptr)
Return list of user tables Parameter wild specifies wildcard for table names.
virtual const char * ServerInfo()=0
virtual TSQLResult * Query(const char *sql)=0
virtual TSQLResult * GetTables(const char *dbname, const char *wild=nullptr)=0
virtual Bool_t IsError() const
static void SetFloatFormat(const char *fmt="%e")
set printf format for float/double members, default "%e"
static const char * fgFloatFmt
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.: mysql://pcroot....
virtual TSQLStatement * Statement(const char *, Int_t=100)
virtual Int_t DropDataBase(const char *dbname)=0
static const char * GetFloatFormat()
return current printf format for float/double members, default "%e"
virtual Bool_t IsConnected() const
ESQLDataTypes
printf argument for floats and doubles, either "%f" or "%e" or "%10f" and so on
const char * Data() const