database¶
Bindings for basic::database namespace
- pyrosetta.rosetta.basic.database.attributes_for_parse_database_connection(: pyrosetta.rosetta.std.list_utility_tag_XMLSchemaAttribute_t, xsd: utility::tag::XMLSchemaDefinition) None ¶
C++: basic::database::attributes_for_parse_database_connection(class std::list<class utility::tag::XMLSchemaAttribute, class std::allocator<class utility::tag::XMLSchemaAttribute> > &, class utility::tag::XMLSchemaDefinition &) –> void
- pyrosetta.rosetta.basic.database.check_statement_sanity(sql: str) None ¶
C++: basic::database::check_statement_sanity(std::string) –> void
- pyrosetta.rosetta.basic.database.db_partition_from_options(db_mode: pyrosetta.rosetta.utility.sql_database.DatabaseMode.e) int ¶
Returns partition identifer if in partitioned database mode, otherwise -1.
C++: basic::database::db_partition_from_options(enum utility::sql_database::DatabaseMode::e) –> long
- pyrosetta.rosetta.basic.database.find_cache_file(cache_file: str, dir_only: bool) bool ¶
- Does cache file (absolute path) exist?
if dir_only is true, will return true if the cache file could be created.
C++: basic::database::find_cache_file(const std::string &, bool) –> bool
- pyrosetta.rosetta.basic.database.find_database_path(*args, **kwargs)¶
Overloaded function.
find_database_path(dir: str, filename: str) -> str
find_database_path(dir: str, filename: str, mute_error_if_failure: bool) -> str
Find a path to a file.
Try various combinations to locate the specific file being requested by the user. (inspired by core::scoring::ScoreFunction::find_weights_file())
mute_error_if_failure returns “” if the file does not exist instead of throwing a loud exception
dir like chemical/carbohydrates/linkage_conformers/
C++: basic::database::find_database_path(const std::string &, const std::string &, bool) –> std::string
find_database_path(dir: str, filename: str, ext: str) -> str
Find a path to a file.
Try various combinations to locate the specific file being requested by the user. (inspired by core::scoring::ScoreFunction::find_weights_file())
dir like chemical/carbohydrates/linkage_conformers/
C++: basic::database::find_database_path(const std::string &, const std::string &, const std::string &) –> std::string
- pyrosetta.rosetta.basic.database.full_cache_name(short_name: str, source_file: str, for_writing: bool) str ¶
- Get the (absolute) path to a given cached file.
If source_file is given, it’s the full path to the source database file that’s being cached. If for_writing is true, will only check that the given file would be creatable. Will return an empty string if it can’t find a cache file.
C++: basic::database::full_cache_name(const std::string &, const std::string &, bool) –> std::string
- pyrosetta.rosetta.basic.database.full_name(*args, **kwargs)¶
Overloaded function.
full_name(db_file: str) -> str
full_name(db_file: str, warn: bool) -> str
Full-path database file name
C++: basic::database::full_name(const std::string &, bool) –> std::string
- pyrosetta.rosetta.basic.database.get_db_session(*args, **kwargs)¶
Overloaded function.
get_db_session() -> utility::sql_database::session
- Aquire a database session using the command line options
transaction type is set to standard
C++: basic::database::get_db_session() –> class std::shared_ptr<class utility::sql_database::session>
get_db_session(db_name: str) -> utility::sql_database::session
get_db_session(db_name: str, pq_schema: str) -> utility::sql_database::session
- Aquire a database session using the command line parameters
For postgres databases, the pq_schema acts like a namespace in the database. Transaction type set to standard
C++: basic::database::get_db_session(const std::string &, const std::string &) –> class std::shared_ptr<class utility::sql_database::session>
get_db_session(db_name: str, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int) -> utility::sql_database::session
get_db_session(db_name: str, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int, pq_schema: str) -> utility::sql_database::session
- Aquire a database session using the command line parameters
For postgres databases, the pq_schema acts like a namespace in the database
C++: basic::database::get_db_session(const std::string &, enum utility::sql_database::TransactionMode::e, unsigned long, const std::string &) –> class std::shared_ptr<class utility::sql_database::session>
get_db_session(db_mode: pyrosetta.rosetta.utility.sql_database.DatabaseMode.e, db_name: str) -> utility::sql_database::session
get_db_session(db_mode: pyrosetta.rosetta.utility.sql_database.DatabaseMode.e, db_name: str, pq_schema: str) -> utility::sql_database::session
C++: basic::database::get_db_session(enum utility::sql_database::DatabaseMode::e, const std::string &, const std::string &) –> class std::shared_ptr<class utility::sql_database::session>
get_db_session(db_mode: pyrosetta.rosetta.utility.sql_database.DatabaseMode.e, transaction_mode: pyrosetta.rosetta.utility.sql_database.TransactionMode.e, chunk_size: int, db_name: str) -> utility::sql_database::session
get_db_session(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) -> utility::sql_database::session
- Aquire a database session using the command line parameters
For postgres databases, the pq_schema acts like a namespace in the database
C++: basic::database::get_db_session(enum utility::sql_database::DatabaseMode::e, enum utility::sql_database::TransactionMode::e, unsigned long, const std::string &, const std::string &) –> class std::shared_ptr<class utility::sql_database::session>
- pyrosetta.rosetta.basic.database.insert_or_ignore(table_name: str, column_names: pyrosetta.rosetta.std.vector_std_string, values: pyrosetta.rosetta.std.vector_std_string, db_session: utility::sql_database::session) None ¶
C++: basic::database::insert_or_ignore(std::string, class std::vector<std::string, class std::allocator<std::string > >, class std::vector<std::string, class std::allocator<std::string > >, class std::shared_ptr<class utility::sql_database::session>) –> void
- pyrosetta.rosetta.basic.database.make_compound_statement(table_name: str, column_names: pyrosetta.rosetta.std.vector_std_string, row_count: int) str ¶
C++: basic::database::make_compound_statement(const std::string &, const class std::vector<std::string, class std::allocator<std::string > > &, const unsigned long &) –> std::string
- pyrosetta.rosetta.basic.database.open(*args, **kwargs)¶
Overloaded function.
open(db_stream: utility::io::izstream, db_file: str) -> bool
open(db_stream: utility::io::izstream, db_file: str, warn: bool) -> bool
Open a database file on a provided stream
C++: basic::database::open(class utility::io::izstream &, const std::string &, bool) –> bool
- pyrosetta.rosetta.basic.database.parse_database_connection(tag: utility::tag::Tag) utility::sql_database::session ¶
C++: basic::database::parse_database_connection(class std::shared_ptr<const class utility::tag::Tag>) –> class std::shared_ptr<class utility::sql_database::session>
- pyrosetta.rosetta.basic.database.prepare_statement_no_catch(statement_string: str, db_session: utility::sql_database::session) pyrosetta.rosetta.cppdb.statement ¶
- Do not catch the error - leave the catch for the code using it.
Do not use this unless YOU are catching any erorrs (cppdb::error).
C++: basic::database::prepare_statement_no_catch(const std::string &, class std::shared_ptr<class utility::sql_database::session>) –> class cppdb::statement
- pyrosetta.rosetta.basic.database.resolve_db_partition(*args, **kwargs)¶
Overloaded function.
resolve_db_partition(partition_by_mpi_process: bool) -> int
resolve_db_partition(partition_by_mpi_process: bool, manual_partition: int) -> int
Returns partition identifer from mpi rank if in partitioned database mode, or valid manual partition, otherwise -1.
C++: basic::database::resolve_db_partition(bool, long) –> long
- pyrosetta.rosetta.basic.database.safely_prepare_statement(statement_string: str, db_session: utility::sql_database::session) pyrosetta.rosetta.cppdb.statement ¶
C++: basic::database::safely_prepare_statement(const std::string &, class std::shared_ptr<class utility::sql_database::session>) –> class cppdb::statement
- pyrosetta.rosetta.basic.database.safely_read_from_database(statement: pyrosetta.rosetta.cppdb.statement) pyrosetta.rosetta.cppdb.result ¶
C++: basic::database::safely_read_from_database(class cppdb::statement &) –> class cppdb::result
- pyrosetta.rosetta.basic.database.safely_write_to_database(statement: pyrosetta.rosetta.cppdb.statement) None ¶
C++: basic::database::safely_write_to_database(class cppdb::statement &) –> void
- pyrosetta.rosetta.basic.database.set_cache_size(db_session: utility::sql_database::session, cache_size: int) None ¶
set the number of 1kb pages to use for cache
C++: basic::database::set_cache_size(class std::shared_ptr<class utility::sql_database::session>, unsigned long) –> void
- pyrosetta.rosetta.basic.database.table_exists(db_session: utility::sql_database::session, table_name: str) bool ¶
C++: basic::database::table_exists(class std::shared_ptr<class utility::sql_database::session>, const std::string &) –> bool