23 #include <utility/tag/Tag.hh>
27 #include <utility/sql_database/DatabaseSessionManager.hh>
30 #include <basic/database/sql_utils.hh>
33 #include <cppdb/frontend.h>
37 #include <utility/excn/Exceptions.hh>
43 using std::stringstream;
47 using utility::sql_database::sessionOP;
49 using basic::database::parse_database_connection;
54 namespace loops_definers {
66 db_session_(src.db_session_),
67 database_table_(src.database_table_)
90 tag->getOption<
string>(
"database_table",
"loops");
92 string const type(tag->getName());
94 if(!tag->hasOption(
"name")){
95 throw utility::excn::EXCN_RosettaScriptsOption(
96 "Unable to create unnamed LoopsDefiner (type: " + type +
")" );
98 string const loops_name(tag->getOption<
string>(
"name"));
107 string pose_tag(JobDistributor::get_instance()->
current_job()->input_tag());
109 stringstream sql_stmt;
111 <<
"SELECT start, stop, cut, skip_rate, extended FROM " <<
database_table_
112 <<
" WHERE tag='" << pose_tag <<
"';";
113 result res = (*db_session_) << sql_stmt.str();
122 loop_list.push_back(loop);
125 if(loop_list.size() == 0){
128 <<
"Unable to locate loops for job distributor input tag '"
129 << pose_tag <<
"' in database." << endl;
130 utility_exit_with_message(error_message.str());