SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
DatabaseManager Class Reference

#include <DatabaseManager.h>

Inheritance diagram for DatabaseManager:

Public Member Functions

 DatabaseManager ()
 
 ~DatabaseManager ()
 
bool run_sql_statement (const std::string &sql_str, ResultSet &results, std::string &error)
 
bool run_sql_statement (const std::string &sql_str, std::string &error)
 
bool run_sql_script (const std::string &sql_str, std::string &error)
 
bool save_database (const boost::filesystem::path &database_file, std::string &error)
 
bool load_database (const boost::filesystem::path &database_file, std::string &error)
 
long long get_last_insert_rowid ()
 
bool get_column_metadata (const std::string &table_name, const std::string &column_name, char const **data_type=0, char const **coll_seq=0, int *not_null=0, int *primary_key=0, int *auto_inc=0)
 

Static Public Member Functions

static std::string EscapeQuotes (const std::string &str)
 

Constructor & Destructor Documentation

Member Function Documentation

std::string EscapeQuotes ( const std::string &  str)
static

ESCAPEQUOTES: Escape the quotes(') in the string so it can be used as text in a SQL statement.

bool get_column_metadata ( const std::string &  table_name,
const std::string &  column_name,
char const **  data_type = 0,
char const **  coll_seq = 0,
int *  not_null = 0,
int *  primary_key = 0,
int *  auto_inc = 0 
)

GET_COLUMN_METADATA: Get metadata about a specific column of a specific database table. Returns true if the table and column exist, otherwise false.

long long get_last_insert_rowid ( )

GET_LAST_INSERT_ROWID: Return the row ID of last successful insert statement.

bool load_database ( const boost::filesystem::path &  database_file,
std::string &  error 
)

LOAD_DATABASE: Load the database from disk

bool run_sql_script ( const std::string &  sql_str,
std::string &  error 
)

RUN_SQL_SCRIPT: Execute multiple SQL statements sequentially.

bool run_sql_statement ( const std::string &  sql_str,
ResultSet results,
std::string &  error 
)

RUN_SQL_STATEMENT: Execute the given SQL statement on the database. If the statement generates any results, they will be put in the result set. Returns true on success, otherwise false.

bool run_sql_statement ( const std::string &  sql_str,
std::string &  error 
)

RUN_SQL_STATEMENT: Execute the given SQL statement on the database. Returns true on success, otherwise false.

bool save_database ( const boost::filesystem::path &  database_file,
std::string &  error 
)

SAVE_DATABASE: Save the database to disk


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