FOSSology
4.4.0
Open Source License Compliance by Open Source Software
|
DB wrapper for agents. More...
#include <libfossdbmanagerclass.hpp>
Public Member Functions | |
DbManager (int *argc, char **argv) | |
Constructor for DbManager. More... | |
DbManager (fo_dbManager *dbManager) | |
PGconn * | getConnection () const |
DbManager | spawn () const |
fo_dbManager * | getStruct_dbManager () const |
bool | tableExists (const char *tableName) const |
bool | sequenceExists (const char *name) const |
bool | begin () const |
bool | commit () const |
bool | rollback () const |
void | ignoreWarnings (bool) const |
QueryResult | queryPrintf (const char *queryFormat,...) const |
Execute a query in printf format. More... | |
QueryResult | execPrepared (fo_dbManager_PreparedStatement *stmt,...) const |
Execute a prepared statement with new parameters. More... | |
Private Attributes | |
unptr::shared_ptr< fo_dbManager > | dbManager |
Shared DB manager. | |
DB wrapper for agents.
Definition at line 48 of file libfossdbmanagerclass.hpp.
DbManager::DbManager | ( | int * | argc, |
char ** | argv | ||
) |
Constructor for DbManager.
Store a shared pointer for DB Manager
Definition at line 49 of file libfossdbmanagerclass.cc.
DbManager::DbManager | ( | fo_dbManager * | _dbManager | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 57 of file libfossdbmanagerclass.cc.
bool DbManager::begin | ( | ) | const |
BEGIN a transaction block
Definition at line 117 of file libfossdbmanagerclass.cc.
bool DbManager::commit | ( | ) | const |
COMMIT a transaction block
Definition at line 127 of file libfossdbmanagerclass.cc.
QueryResult DbManager::execPrepared | ( | fo_dbManager_PreparedStatement * | stmt, |
... | |||
) | const |
Execute a prepared statement with new parameters.
stmt | Pointer to the prepared statement |
Definition at line 170 of file libfossdbmanagerclass.cc.
PGconn * DbManager::getConnection | ( | ) | const |
Get bare DB connection object
Definition at line 66 of file libfossdbmanagerclass.cc.
fo_dbManager * DbManager::getStruct_dbManager | ( | ) | const |
Get the C wrapper for DB manager
Definition at line 85 of file libfossdbmanagerclass.cc.
void DbManager::ignoreWarnings | ( | bool | b | ) | const |
Set the ignore warning flag for connection
b | True to ignore waring |
Definition at line 185 of file libfossdbmanagerclass.cc.
QueryResult DbManager::queryPrintf | ( | const char * | queryFormat, |
... | |||
) | const |
Execute a query in printf format.
This function can execute a query using the printf format (s
, d
, etc. placeholder in queryFormat).
queryFormat | Printf styled string format |
Definition at line 151 of file libfossdbmanagerclass.cc.
bool DbManager::rollback | ( | ) | const |
ROLLBACK a transaction block
Definition at line 137 of file libfossdbmanagerclass.cc.
bool DbManager::sequenceExists | ( | const char * | name | ) | const |
Check if a sequence exists in Database
name | Sequence to check |
Definition at line 107 of file libfossdbmanagerclass.cc.
DbManager DbManager::spawn | ( | ) | const |
Fork a new DB connection
Definition at line 76 of file libfossdbmanagerclass.cc.
bool DbManager::tableExists | ( | const char * | tableName | ) | const |
Check if a table exists in Database
tableName | Table to check |
Definition at line 96 of file libfossdbmanagerclass.cc.