|
void | beginTransaction () const |
| begin a transaction More...
|
|
virtual void | commitTransaction () const |
| commit a transaction More...
|
|
virtual std::string | createMonitorDataTable (const monitorTableAverageType &averageType, const monitorTableDataType dataType, const std::string &tag, const std::string *const location) const |
| create a monitor data table More...
|
|
virtual bool | inTransaction () const |
| is a transaction being executed? More...
|
|
bool | isDBUp () const |
| destructor More...
|
|
void | loadDataFromFile (const std::string &filename, const std::string &table, const std::string &user, const bool &useTransactions, const bool &useProductionDB) const |
|
void | loadDataFromFiles (const file2TableMap &file2Table, const std::string &user, const bool &useTransactions, const bool &useProductionDB) const |
|
| PostgresDBConnection (const bool &useProductionDB, const string *const odbcini) |
| constructor More...
|
|
virtual void | rollBackTransaction () const |
| rollback a transaction More...
|
|
virtual std::string | caseSensitiveSearchModifier () const |
| get the modifier necessary for a case-sensitive text search More...
|
|
void | closeConnection () |
| close the ODBC database connection More...
|
|
virtual std::string | createMonitorDataTable (const MonitorAverageType &averageType, const MonitorAggregateType &aggType, const std::string &tag, const std::string *const location=NULL) const =0 |
| create a monitor data table More...
|
|
carma::dbms::Table | databaseInfo (const std::string &database="") const |
| get info on the database More...
|
|
std::string | dataSource () const |
| is this object using the production database? More...
|
|
virtual void | deleteFromMonitorIndexTable (const std::string &whereClause) const |
| delete rows from the MONITOR_INDEX_TABLE More...
|
|
virtual void | dropScratchTable (const std::string &table) const |
| drop a table from the scratch database More...
|
|
virtual void | execSQLDropTable (const std::string &tableName) const |
| drop a table. More...
|
|
virtual carma::dbms::Table | execSQLSelect (const std::string &statement, const std::string &resultTableName="RESULT TABLE") const |
| execute a SELECT query More...
|
|
virtual carma::dbms::Table | execSQLSelect (const std::vector< std::string > &columnNames, const std::string &tableName, const std::string &whereClause="", const std::string &orderByClause="", const std::string &groupByClause="", const std::string &havingClause="", const std::string &resultTableName="RESULT TABLE") const |
| execute a SELECT query More...
|
|
virtual void * | getAggregate (const std::string &column, const std::string &table, const std::string &function, carma::dbms::Table::ColumnType &type) const |
| get the specified aggregate value of the specified column from the specified table. More...
|
|
Table | getLogMessages (const carma::util::frameType &start, const carma::util::frameType &end=carma::util::Time::computeCurrentFrame(), const std::string *matchString=NULL) const |
| get the log messages in the specified frameCount range. More...
|
|
virtual long | getRowCount (const std::string &tableName) const |
| get the number of rows in the specified table More...
|
|
void | insertLogMessage (const std::string &message, const carma::util::frameType &frameCount=carma::util::Time::computeCurrentFrame()) const |
| add a log message to the Log table More...
|
|
virtual bool | isDBUp () |
| is the RDBMS in question up and accepting connections More...
|
|
virtual void | loadDataFromFile (const std::string &filename, const std::string &table, const bool &useTransactions, const int &linesToIgnore=0, const std::string &columnDelimiter="\t") const =0 |
| load data into a table from a disk file. More...
|
|
virtual void | loadDataFromFiles (const file2TableMap &file2Table, const bool &useTransactions, const int &linesToIgnore=0, const std::string &columnDelimiter="\t") const =0 |
| load data into tables from disk files. More...
|
|
virtual unsigned | maxColumnsPerTable () const =0 |
| the maximum number of columns the RDBMS allows in a table More...
|
|
virtual unsigned | maxTablesPerJoin () const =0 |
| the maximum number of tables the RDBMS allows in a join More...
|
|
virtual void | monitorDataTableHasBeenPopulated (const std::string &tableName, const MonitorAverageType &averageType) const |
| performs tasks after a monitor data table has been completely populated. More...
|
|
void | odbcInfo () const |
| print various details about ODBC support More...
|
|
std::string | rdbmsName () const |
| get the name of the RDBMS associated with this object More...
|
|
virtual void | repairMonitorDataTable (const std::string &tableName) const =0 |
| attempt to repair a corrupt monitor data table More...
|
|
bool | tableExists (const std::string &table, const std::string &database) const |
| does the specified table exist in the specified database? More...
|
|
virtual | ~DBConnection () |
| destructor, derived classes may want to override More...
|
|
|
typedef std::map< std::string,
std::string > | file2TableMap |
| type to map data file names to tables they should be loaded into More...
|
|
static std::string | createInsertStatement (const std::string &tableName, const std::vector< std::string > columns, const std::vector< std::string > values) |
| create an SQL insert statement More...
|
|
static std::string | createInsertStatement (const std::string &tableName, const std::vector< std::string > columns, const std::string values) |
| create an SQL insert statement "INSERT INTO " + tableName + "(" More...
|
|
static std::string | createJoinClause (const std::string &leftTable, const std::string &rightTable, const std::string &leftColumn, const std::string &rightColumn="", const std::string &rightTableAlias="", const std::string &indexCol="") |
| create a (inner) join clause More...
|
|
static std::string | createJoinClause (const std::string &joinTable, const std::string &onClause) |
| create a (inner) join clause More...
|
|
static bool | isUp (const DBConfigurator *dbconf=NULL) |
| is the database specified by the dbconf object up and accepting connections? More...
|
|
void | closeODBCConnection_ () |
| close a database connection using ODBC, henv_ and hdbc_ are freed here More...
|
|
void | closeODBCConnection_ (SQLHENV henv, SQLHDBC hdbc) const |
|
| DBConnection (const carma::dbms::DBConfigurator *dbconf) |
| create a DBConnection object. More...
|
|
void | directSQLExec_ (const SQLHSTMT hstmt, const std::string &statement) const |
| execute a single SQL statement More...
|
|
void | directSQLExec_ (const std::string &statement) const |
| execute a single SQL statement directly More...
|
|
void | directSQLInsert_ (const std::string &statement) const |
| perform a single sql insert statement directly (ie, no prepared statements More...
|
|
void | freeSQLStatement_ (const SQLHSTMT &hstmt) const |
| free an ODBC statment handle More...
|
|
carma::dbms::Table | odbcResultSetToTable_ (const SQLHSTMT &hstmt) const |
| convert an ODBC result set to a carma::dbms::Table object More...
|
|
void | openODBCConnection_ (SQLHENV *henv, SQLHDBC *hdbc) |
| open a database connection using ODBC, henv_ and hdbc_ are initialized here More...
|
|
void | openODBCConnection_ () |
|
std::string | readPassword_ () const |
| read the database user's password so that it can be sent to the ODBC driver as part of the connect string IMPORTANT! Passwords are considered sensitive information and so the files in which they reside should be readable only by the unix account which owns them More...
|
|
std::vector< SQLHSTMT > | activeStatements |
|
std::string | dataSource_ |
|
std::string | dbname_ |
|
std::string | dbuser_ |
|
SQLHDBC | hdbc_ |
| connection and environment handles for ODBC interface More...
|
|
SQLHENV | henv_ |
|
bool | inTxn_ |
|
log4cpp::Category & | logger_ |
|
std::string | odbcConnectString_ |
|
std::string | odbcini_ |
| odbc config file More...
|
|
std::string | passwordFile_ |
|
unsigned | port_ |
|
std::string | rdbmsName_ |
|
std::string | socket_ |
|
an DBConnection implementation for PostgreSQL
Definition at line 28 of file PostgresDBConnection.h.