MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / getRunID

Method getRunID

src/openms/source/FORMAT/OSWFile.cpp:589–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587 }
588
589 UInt64 OSWFile::getRunID() const
590 {
591 SqliteConnector conn(filename_);
592 Size nr_results = 0;
593
594 std::string select_sql = "SELECT RUN.ID FROM RUN;";
595
596 sqlite3_stmt* stmt;
597 conn.prepareStatement(&stmt, select_sql);
598 Sql::SqlState state = Sql::SqlState::SQL_ROW;
599 UInt64 id;
600 while ((state = Sql::nextRow(stmt, state)) == Sql::SqlState::SQL_ROW)
601 {
602 ++nr_results;
603 id = Sql::extractInt64(stmt, 0);
604 }
605 // free memory
606 sqlite3_finalize(stmt);
607
608 if (nr_results != 1)
609 {
610 throw Exception::SqlOperationFailed(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "File '" + filename_ + "' contains more than one run. This is currently not supported!");
611 }
612 return id;
613 }
614
615 void OSWFile::readTransitions_(OSWData& swath_result)
616 {

Callers 2

OSWFile_test.cppFile · 0.45

Calls 3

nextRowFunction · 0.85
extractInt64Function · 0.85
prepareStatementMethod · 0.80

Tested by

no test coverage detected