MIDAS
Loading...
Searching...
No Matches
SqlDebug Class Reference
Inheritance diagram for SqlDebug:
Collaboration diagram for SqlDebug:

Public Member Functions

 SqlDebug ()
 
 ~SqlDebug ()
 
int SetDebug (int debug)
 
int Connect (const char *filename=NULL)
 
int Exec (const char *sql)
 
int Disconnect ()
 
bool IsConnected ()
 
int GetNumRows ()
 
int GetNumColumns ()
 
int Fetch ()
 
int Done ()
 
int ListTables (std::vector< std::string > *plist)
 
int ListColumns (const char *table, std::vector< std::string > *plist)
 
const charGetColumn (int icol)
 
- Public Member Functions inherited from SqlBase
virtual ~SqlBase ()
 
 SqlBase ()
 
virtual ~SqlBase ()
 
virtual int Exec (const char *table_name, const char *sql)=0
 
virtual int ExecDisconnected (const char *table_name, const char *sql)=0
 
virtual int Prepare (const char *table_name, const char *sql)=0
 
virtual int Step ()=0
 
virtual const charGetText (int column)=0
 
virtual time_t GetTime (int column)=0
 
virtual double GetDouble (int column)=0
 
virtual int Finalize ()=0
 
virtual int OpenTransaction (const char *table_name)=0
 
virtual int CommitTransaction (const char *table_name)=0
 
virtual int RollbackTransaction (const char *table_name)=0
 
virtual const charColumnType (int midas_tid)=0
 
virtual bool TypesCompatible (int midas_tid, const char *sql_type)=0
 
virtual std::string QuoteString (const char *s)=0
 
virtual std::string QuoteId (const char *s)=0
 

Public Attributes

FILEfp
 
bool fIsConnected
 
int fDebug
 
- Public Attributes inherited from SqlBase
int fDebug
 
bool fIsConnected
 
bool fTransactionPerTable
 

Detailed Description

Definition at line 208 of file history_odbc.cxx.

Constructor & Destructor Documentation

◆ SqlDebug()

SqlDebug::SqlDebug ( )
inline

Definition at line 217 of file history_odbc.cxx.

218 {
219 fp = NULL;
220 fIsConnected = false;
221 }
bool fIsConnected
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
Here is the call graph for this function:

◆ ~SqlDebug()

SqlDebug::~SqlDebug ( )
inline

Definition at line 223 of file history_odbc.cxx.

224 {
225 if (fp)
226 fclose(fp);
227 fp = NULL;
228 }
Here is the call graph for this function:

Member Function Documentation

◆ Connect()

int SqlDebug::Connect ( const char filename = NULL)
inlinevirtual

Implements SqlBase.

Definition at line 237 of file history_odbc.cxx.

238 {
239 if (!filename)
240 filename = "/dev/fd/1";
241 fp = fopen(filename, "w");
242 assert(fp);
244 fIsConnected = true;
245 return DB_SUCCESS;
246 }
#define DB_SUCCESS
Definition midas.h:631
static const char * sql_type_mysql[]
static const char ** sql_type
Here is the call graph for this function:

◆ Disconnect()

int SqlDebug::Disconnect ( )
inlinevirtual

Implements SqlBase.

Definition at line 254 of file history_odbc.cxx.

255 {
256 // do nothing
257 fIsConnected = false;
258 return DB_SUCCESS;
259 }

◆ Done()

int SqlDebug::Done ( )
inlinevirtual

Implements SqlBase.

Definition at line 269 of file history_odbc.cxx.

269{ return DB_SUCCESS; }

◆ Exec()

int SqlDebug::Exec ( const char sql)
inlinevirtual

Implements SqlBase.

Definition at line 248 of file history_odbc.cxx.

249 {
250 fprintf(fp, "%s\n", sql);
251 return DB_SUCCESS;
252 }
Here is the call graph for this function:

◆ Fetch()

int SqlDebug::Fetch ( )
inlinevirtual

Implements SqlBase.

Definition at line 268 of file history_odbc.cxx.

268{ return DB_NO_MORE_SUBKEYS; }
#define DB_NO_MORE_SUBKEYS
Definition midas.h:646

◆ GetColumn()

const char * SqlDebug::GetColumn ( int  icol)
inlinevirtual

Implements SqlBase.

Definition at line 272 of file history_odbc.cxx.

272{ return NULL; };
Here is the call graph for this function:

◆ GetNumColumns()

int SqlDebug::GetNumColumns ( )
inlinevirtual

Implements SqlBase.

Definition at line 267 of file history_odbc.cxx.

267{ return DB_SUCCESS; }

◆ GetNumRows()

int SqlDebug::GetNumRows ( )
inlinevirtual

Implements SqlBase.

Definition at line 266 of file history_odbc.cxx.

266{ return DB_SUCCESS; }

◆ IsConnected()

bool SqlDebug::IsConnected ( )
inlinevirtual

Implements SqlBase.

Definition at line 261 of file history_odbc.cxx.

262 {
263 return fIsConnected;
264 }

◆ ListColumns()

int SqlDebug::ListColumns ( const char table,
std::vector< std::string > *  plist 
)
inlinevirtual

Implements SqlBase.

Definition at line 271 of file history_odbc.cxx.

271{ return DB_SUCCESS; };

◆ ListTables()

int SqlDebug::ListTables ( std::vector< std::string > *  plist)
inlinevirtual

Implements SqlBase.

Definition at line 270 of file history_odbc.cxx.

270{ return DB_SUCCESS; };

◆ SetDebug()

int SqlDebug::SetDebug ( int  debug)
inlinevirtual

Implements SqlBase.

Definition at line 230 of file history_odbc.cxx.

231 {
232 int old_debug = fDebug;
233 fDebug = debug;
234 return old_debug;
235 }
BOOL debug
debug printouts
Definition mana.cxx:254
Here is the call graph for this function:

Member Data Documentation

◆ fDebug

int SqlDebug::fDebug

Definition at line 213 of file history_odbc.cxx.

◆ fIsConnected

bool SqlDebug::fIsConnected

Definition at line 212 of file history_odbc.cxx.

◆ fp

FILE* SqlDebug::fp

Definition at line 211 of file history_odbc.cxx.


The documentation for this class was generated from the following file: