#include <DatabaseSessionManager.hh>
|
virtual | ~DatabaseSessionManager () |
|
sessionOP | get_db_session (DatabaseMode::e db_mode, TransactionMode::e transaction_mode, platform::Size chunk_size, std::string const &db_name, std::string const &pq_schema, std::string const &host, std::string const &user, std::string const &password, platform::Size port, bool readonly=false, platform::SSize db_partition=-1) |
| Acquire a database session. More...
|
|
sessionOP | get_session_sqlite3 (std::string const &database, TransactionMode::e transaction_mode=utility::sql_database::TransactionMode::standard, platform::Size chunk_size=0, bool const readonly=false, platform::SSize db_partition=-1) |
| Acquire a sqlite3 database session. More...
|
|
sessionOP | get_session_mysql (std::string const &database, TransactionMode::e transaction_mode, platform::Size chunk_size, std::string const &host, std::string const &user, std::string const &password, platform::Size port) |
| Acquire a mysql database session. More...
|
|
sessionOP | get_session_postgres (std::string const &database, TransactionMode::e transaction_mode, platform::Size chunk_size, std::string const &pq_schema, std::string const &host, std::string const &user, std::string const &password, platform::Size port) |
| Acquire a postgres database session. More...
|
|
| SingletonBase () |
| public constructor (the derived class must have a private constructor, of course). More...
|
|
|
static DatabaseSessionManager * | get_instance () |
| Safely instantiate a singleton class in a (possibly) multithreaded context. More...
|
|
utility::sql_database::DatabaseSessionManager::DatabaseSessionManager |
( |
| ) |
|
|
protecteddefault |
utility::sql_database::DatabaseSessionManager::~DatabaseSessionManager |
( |
| ) |
|
|
virtualdefault |
sessionOP utility::sql_database::DatabaseSessionManager::get_db_session |
( |
DatabaseMode::e |
db_mode, |
|
|
TransactionMode::e |
transaction_mode, |
|
|
platform::Size |
chunk_size, |
|
|
std::string const & |
db_name, |
|
|
std::string const & |
pq_schema, |
|
|
std::string const & |
host, |
|
|
std::string const & |
user, |
|
|
std::string const & |
password, |
|
|
platform::Size |
port, |
|
|
bool |
readonly = false , |
|
|
platform::SSize |
db_partition = -1 |
|
) |
| |
sessionOP utility::sql_database::DatabaseSessionManager::get_session_postgres |
( |
std::string const & |
database, |
|
|
TransactionMode::e |
transaction_mode, |
|
|
platform::Size |
chunk_size, |
|
|
std::string const & |
pq_schema, |
|
|
std::string const & |
host, |
|
|
std::string const & |
user, |
|
|
std::string const & |
password, |
|
|
platform::Size |
port |
|
) |
| |
void utility::sql_database::DatabaseSessionManager::set_postgres_schema_search_path |
( |
sessionOP |
db_session, |
|
|
utility::vector1< std::string > const & |
schema_search_path |
|
) |
| |
|
private |
postgres does not allow queries between databases, instead it allows tables to be created in different namespaces called "schemas". By specifing the search path, statements will be executed in a specified namespace. Note setting the search path only affects this session.
For example, to use the schema UBQdesign_stage1_r456644_120323, set set the search path with the vector ["UBQdesign_stage1_r456644_120323"]. See: http://www.postgresql.org/docs/8.1/static/ddl-schemas.html
The documentation for this class was generated from the following files: