sql_database

Bindings for utility::sql_database namespace

class pyrosetta.rosetta.utility.sql_database.DatabaseMode

Bases: pybind11_builtins.pybind11_object

class e

Bases: pybind11_builtins.pybind11_object

Members:

sqlite3

mysql

postgres

mysql = <e.mysql: 2>
property name
postgres = <e.postgres: 3>
sqlite3 = <e.sqlite3: 1>
mysql = <e.mysql: 2>
postgres = <e.postgres: 3>
sqlite3 = <e.sqlite3: 1>
class pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager

Bases: pyrosetta.rosetta.utility.SingletonBase_utility_sql_database_DatabaseSessionManager_t

get_db_session(*args, **kwargs)

Overloaded function.

  1. get_db_session(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, db_mode: pyrosetta.rosetta.utility.sql_database.DatabaseMode.e, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int, db_name: str, pq_schema: str, host: str, user: str, password: str, port: int) -> pyrosetta.rosetta.utility.sql_database.session

  2. get_db_session(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, db_mode: pyrosetta.rosetta.utility.sql_database.DatabaseMode.e, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int, db_name: str, pq_schema: str, host: str, user: str, password: str, port: int, readonly: bool) -> pyrosetta.rosetta.utility.sql_database.session

  3. get_db_session(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, db_mode: pyrosetta.rosetta.utility.sql_database.DatabaseMode.e, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int, db_name: str, pq_schema: str, host: str, user: str, password: str, port: int, readonly: bool, db_partition: int) -> pyrosetta.rosetta.utility.sql_database.session

Acquire a database session

C++: utility::sql_database::DatabaseSessionManager::get_db_session(enum utility::sql_database::DatabaseMode::e, enum utility::sql_database::TransactionMode::e, unsigned long, const std::string &, const std::string &, const std::string &, const std::string &, const std::string &, unsigned long, bool, long) –> class std::shared_ptr<class utility::sql_database::session>

static get_instance() utility::sql_database::DatabaseSessionManager

C++: utility::SingletonBase<utility::sql_database::DatabaseSessionManager>::get_instance() –> class utility::sql_database::DatabaseSessionManager *

get_session_mysql(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, database: str, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int, host: str, user: str, password: str, port: int) pyrosetta.rosetta.utility.sql_database.session

Acquire a mysql database session

C++: utility::sql_database::DatabaseSessionManager::get_session_mysql(const std::string &, enum utility::sql_database::TransactionMode::e, unsigned long, const std::string &, const std::string &, const std::string &, unsigned long) –> class std::shared_ptr<class utility::sql_database::session>

get_session_postgres(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, database: str, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int, pq_schema: str, host: str, user: str, password: str, port: int) pyrosetta.rosetta.utility.sql_database.session

Acquire a postgres database session

C++: utility::sql_database::DatabaseSessionManager::get_session_postgres(const std::string &, enum utility::sql_database::TransactionMode::e, unsigned long, const std::string &, const std::string &, const std::string &, const std::string &, unsigned long) –> class std::shared_ptr<class utility::sql_database::session>

get_session_sqlite3(*args, **kwargs)

Overloaded function.

  1. get_session_sqlite3(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, database: str) -> pyrosetta.rosetta.utility.sql_database.session

  2. get_session_sqlite3(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, database: str, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e) -> pyrosetta.rosetta.utility.sql_database.session

  3. get_session_sqlite3(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, database: str, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int) -> pyrosetta.rosetta.utility.sql_database.session

  4. get_session_sqlite3(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, database: str, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int, readonly: bool) -> pyrosetta.rosetta.utility.sql_database.session

  5. get_session_sqlite3(self: pyrosetta.rosetta.utility.sql_database.DatabaseSessionManager, database: str, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int, readonly: bool, db_partition: int) -> pyrosetta.rosetta.utility.sql_database.session

Acquire a sqlite3 database session

C++: utility::sql_database::DatabaseSessionManager::get_session_sqlite3(const std::string &, enum utility::sql_database::TransactionMode::e, unsigned long, const bool, long) –> class std::shared_ptr<class utility::sql_database::session>

class pyrosetta.rosetta.utility.sql_database.TransactionMode

Bases: pybind11_builtins.pybind11_object

chunk = <e.chunk: 3>
class e

Bases: pybind11_builtins.pybind11_object

Members:

none

standard

chunk

chunk = <e.chunk: 3>
property name
none = <e.none: 1>
standard = <e.standard: 2>
none = <e.none: 1>
standard = <e.standard: 2>
pyrosetta.rosetta.utility.sql_database.database_mode_from_name(database_mode: str) pyrosetta.rosetta.utility.sql_database.DatabaseMode.e

C++: utility::sql_database::database_mode_from_name(const std::string &) –> enum utility::sql_database::DatabaseMode::e

pyrosetta.rosetta.utility.sql_database.name_from_database_mode(database_mode: pyrosetta.rosetta.utility.sql_database.DatabaseMode.e) str

C++: utility::sql_database::name_from_database_mode(enum utility::sql_database::DatabaseMode::e) –> std::string

pyrosetta.rosetta.utility.sql_database.name_from_transaction_mode(transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e) str

C++: utility::sql_database::name_from_transaction_mode(enum utility::sql_database::TransactionMode::e) –> std::string

class pyrosetta.rosetta.utility.sql_database.session

Bases: pyrosetta.rosetta.cppdb.session

assign(self: pyrosetta.rosetta.utility.sql_database.session, : pyrosetta.rosetta.utility.sql_database.session) pyrosetta.rosetta.utility.sql_database.session

C++: utility::sql_database::session::operator=(const class utility::sql_database::session &) –> class utility::sql_database::session &

begin(self: pyrosetta.rosetta.cppdb.session) None

C++: cppdb::session::begin() –> void

begin_transaction(self: pyrosetta.rosetta.utility.sql_database.session) None

indicate that a transaction block has begun.

C++: utility::sql_database::session::begin_transaction() –> void

clear_cache(self: pyrosetta.rosetta.cppdb.session) None

C++: cppdb::session::clear_cache() –> void

clear_pool(self: pyrosetta.rosetta.cppdb.session) None

C++: cppdb::session::clear_pool() –> void

close(self: pyrosetta.rosetta.cppdb.session) None

C++: cppdb::session::close() –> void

commit(self: pyrosetta.rosetta.cppdb.session) None

C++: cppdb::session::commit() –> void

commit_transaction(self: pyrosetta.rosetta.utility.sql_database.session) None

indicate that a transaction block has completed. NOTE: When in chunk transaction mode, this may not actually write to the database.

C++: utility::sql_database::session::commit_transaction() –> void

create_prepared_statement(self: pyrosetta.rosetta.cppdb.session, q: str) pyrosetta.rosetta.cppdb.statement

C++: cppdb::session::create_prepared_statement(const std::string &) –> class cppdb::statement

create_prepared_uncached_statement(self: pyrosetta.rosetta.cppdb.session, q: str) pyrosetta.rosetta.cppdb.statement

C++: cppdb::session::create_prepared_uncached_statement(const std::string &) –> class cppdb::statement

create_statement(self: pyrosetta.rosetta.cppdb.session, q: str) pyrosetta.rosetta.cppdb.statement

C++: cppdb::session::create_statement(const std::string &) –> class cppdb::statement

driver(self: pyrosetta.rosetta.cppdb.session) str

C++: cppdb::session::driver() –> std::string

engine(self: pyrosetta.rosetta.cppdb.session) str

C++: cppdb::session::engine() –> std::string

escape(*args, **kwargs)

Overloaded function.

  1. escape(self: pyrosetta.rosetta.cppdb.session, b: str, e: str) -> str

C++: cppdb::session::escape(const char *, const char *) –> std::string

  1. escape(self: pyrosetta.rosetta.cppdb.session, s: str) -> str

C++: cppdb::session::escape(const char *) –> std::string

  1. escape(self: pyrosetta.rosetta.cppdb.session, s: str) -> str

C++: cppdb::session::escape(const std::string &) –> std::string

force_commit_transaction(self: pyrosetta.rosetta.utility.sql_database.session) None

force a transaction to be committed. This should only be used when writing data that is required by other processes, such as protocol and batch ids.

C++: utility::sql_database::session::force_commit_transaction() –> void

get_chunk_size(self: pyrosetta.rosetta.utility.sql_database.session) int

C++: utility::sql_database::session::get_chunk_size() –> unsigned long

get_db_mode(self: pyrosetta.rosetta.utility.sql_database.session) pyrosetta.rosetta.utility.sql_database.DatabaseMode.e

C++: utility::sql_database::session::get_db_mode() const –> enum utility::sql_database::DatabaseMode::e

get_db_name(self: pyrosetta.rosetta.utility.sql_database.session) str

C++: utility::sql_database::session::get_db_name() const –> const std::string &

get_db_partition(self: pyrosetta.rosetta.utility.sql_database.session) int

C++: utility::sql_database::session::get_db_partition() –> long

get_pq_schema(self: pyrosetta.rosetta.utility.sql_database.session) str

C++: utility::sql_database::session::get_pq_schema() const –> const std::string &

get_specific(self: pyrosetta.rosetta.cppdb.session, t: pyrosetta.rosetta.std.type_info) pyrosetta.rosetta.cppdb.connection_specific_data

C++: cppdb::session::get_specific(const class std::type_info &) –> class cppdb::connection_specific_data *

get_transaction_mode(self: pyrosetta.rosetta.utility.sql_database.session) pyrosetta.rosetta.utility.sql_database.TransactionMode.e

C++: utility::sql_database::session::get_transaction_mode() const –> enum utility::sql_database::TransactionMode::e

is_db_partitioned(self: pyrosetta.rosetta.utility.sql_database.session) bool

C++: utility::sql_database::session::is_db_partitioned() –> bool

is_open(self: pyrosetta.rosetta.cppdb.session) bool

C++: cppdb::session::is_open() –> bool

once_called(*args, **kwargs)

Overloaded function.

  1. once_called(self: pyrosetta.rosetta.cppdb.session) -> bool

C++: cppdb::session::once_called() –> bool

  1. once_called(self: pyrosetta.rosetta.cppdb.session, state: bool) -> None

C++: cppdb::session::once_called(bool) –> void

open(*args, **kwargs)

Overloaded function.

  1. open(self: pyrosetta.rosetta.cppdb.session, ci: pyrosetta.rosetta.cppdb.connection_info) -> None

C++: cppdb::session::open(const class cppdb::connection_info &) –> void

  1. open(self: pyrosetta.rosetta.cppdb.session, cs: str) -> None

C++: cppdb::session::open(const std::string &) –> void

open_mysql_session(self: pyrosetta.rosetta.utility.sql_database.session, host: str, user: str, password: str, port: int) None

Convenience function to open a mysql session

C++: utility::sql_database::session::open_mysql_session(const std::string &, const std::string &, const std::string &, unsigned long) –> void

open_postgres_session(self: pyrosetta.rosetta.utility.sql_database.session, host: str, user: str, password: str, port: int) None

Convenience function to open a postgres session

C++: utility::sql_database::session::open_postgres_session(const std::string &, const std::string &, const std::string &, unsigned long) –> void

open_sqlite3_session(*args, **kwargs)

Overloaded function.

  1. open_sqlite3_session(self: pyrosetta.rosetta.utility.sql_database.session) -> None

  2. open_sqlite3_session(self: pyrosetta.rosetta.utility.sql_database.session, read_only: bool) -> None

Convenience function to open an sqlite3 session.

C++: utility::sql_database::session::open_sqlite3_session(bool) –> void

prepare(self: pyrosetta.rosetta.cppdb.session, query: str) pyrosetta.rosetta.cppdb.statement

C++: cppdb::session::prepare(const std::string &) –> class cppdb::statement

recyclable(*args, **kwargs)

Overloaded function.

  1. recyclable(self: pyrosetta.rosetta.cppdb.session) -> bool

C++: cppdb::session::recyclable() –> bool

  1. recyclable(self: pyrosetta.rosetta.cppdb.session, value: bool) -> None

C++: cppdb::session::recyclable(bool) –> void

release_specific(self: pyrosetta.rosetta.cppdb.session, t: pyrosetta.rosetta.std.type_info) pyrosetta.rosetta.cppdb.connection_specific_data

C++: cppdb::session::release_specific(const class std::type_info &) –> class cppdb::connection_specific_data *

reset_specific(*args, **kwargs)

Overloaded function.

  1. reset_specific(self: pyrosetta.rosetta.cppdb.session, t: pyrosetta.rosetta.std.type_info) -> None

  2. reset_specific(self: pyrosetta.rosetta.cppdb.session, t: pyrosetta.rosetta.std.type_info, p: pyrosetta.rosetta.cppdb.connection_specific_data) -> None

C++: cppdb::session::reset_specific(const class std::type_info &, class cppdb::connection_specific_data *) –> void

rollback(self: pyrosetta.rosetta.cppdb.session) None

C++: cppdb::session::rollback() –> void

set_chunk_size(self: pyrosetta.rosetta.utility.sql_database.session, chunk_size: int) None

C++: utility::sql_database::session::set_chunk_size(const unsigned long) –> void

set_db_mode(self: pyrosetta.rosetta.utility.sql_database.session, db_mode: pyrosetta.rosetta.utility.sql_database.DatabaseMode.e) None

C++: utility::sql_database::session::set_db_mode(const enum utility::sql_database::DatabaseMode::e) –> void

set_db_name(self: pyrosetta.rosetta.utility.sql_database.session, db_name: str) None

C++: utility::sql_database::session::set_db_name(const std::string &) –> void

set_db_partition(self: pyrosetta.rosetta.utility.sql_database.session, db_partition: int) None

C++: utility::sql_database::session::set_db_partition(long) –> void

set_pq_schema(self: pyrosetta.rosetta.utility.sql_database.session, pq_schema: str) None

C++: utility::sql_database::session::set_pq_schema(const std::string &) –> void

set_transaction_mode(self: pyrosetta.rosetta.utility.sql_database.session, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e) None

C++: utility::sql_database::session::set_transaction_mode(const enum utility::sql_database::TransactionMode::e) –> void

class pyrosetta.rosetta.utility.sql_database.transaction

Bases: pyrosetta.rosetta.cppdb.transaction

commit(self: pyrosetta.rosetta.cppdb.transaction) None

C++: cppdb::transaction::commit() –> void

rollback(self: pyrosetta.rosetta.cppdb.transaction) None

C++: cppdb::transaction::rollback() –> void

pyrosetta.rosetta.utility.sql_database.transaction_mode_from_name(transaction_mode: str) pyrosetta.rosetta.utility.sql_database.TransactionMode.e

C++: utility::sql_database::transaction_mode_from_name(const std::string &) –> enum utility::sql_database::TransactionMode::e