-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow for SQLite DBMS for RCDB (#288)
- Loading branch information
Showing
12 changed files
with
79 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# RCDB's SQLite header | ||
odr_violation:SQLite::* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,22 +10,35 @@ | |
namespace iguana { | ||
|
||
/// @brief RCDB reader | ||
/// | ||
/// This class interfaces to the RCDB. The database connection path is chosen from one of the following, in order: | ||
/// - The global variable `iguana::GlobalRcdbUrl`; by default this is not set to any value (its type is `iguana::GlobalParam`) | ||
/// - The environment variable `RCDB_CONNECTION` (which is likely set if you are on `ifarm`) | ||
/// - A default URL, which will be printed in a warning; see `iguana::RCDBReader::m_default_url` | ||
/// | ||
/// RCDB will automatically use `mariadb` / `mysql` or `sqlite`, depending on the above RCDB database path, | ||
/// and whether you have satisfied the dependencies. | ||
class RCDBReader : public Object | ||
{ | ||
|
||
public: | ||
|
||
/// @param name the name of this reader | ||
RCDBReader(std::string_view name = "rcdb"); | ||
/// @param lev the log level | ||
RCDBReader(std::string_view name = "rcdb", Logger::Level lev = Logger::DEFAULT_LEVEL); | ||
|
||
/// @param runnum run number | ||
/// @returns the beam energy in GeV | ||
double GetBeamEnergy(int const runnum); | ||
|
||
protected: | ||
|
||
/// @brief default RCDB URL, used as a last resort | ||
std::string const m_default_url = "mysql://[email protected]/rcdb"; | ||
|
||
private: | ||
|
||
std::string m_url; | ||
std::string const default_url = "mysql://[email protected]/rcdb"; | ||
std::once_flag m_error_once; | ||
|
||
#ifdef USE_RCDB | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters