https://halldweb1.jlab.org/wiki/index.php?title=HOWTO_update_a_condition_on_the_RCDB&feed=atom&action=historyHOWTO update a condition on the RCDB - Revision history2024-03-29T11:48:39ZRevision history for this page on the wikiMediaWiki 1.24.1https://halldweb1.jlab.org/wiki/index.php?title=HOWTO_update_a_condition_on_the_RCDB&diff=104992&oldid=prevSdobbs: Created page with "Sometimes the information in the RCDB needs to be modified. The first warning is to BE VERY CAREFUL when you are doing this, since the RCDB does not keep any history of modif..."2021-05-03T15:38:32Z<p>Created page with "Sometimes the information in the RCDB needs to be modified. The first warning is to BE VERY CAREFUL when you are doing this, since the RCDB does not keep any history of modif..."</p>
<p><b>New page</b></p><div>Sometimes the information in the RCDB needs to be modified. The first warning is to BE VERY CAREFUL when you are doing this, since the RCDB does not keep any history of modifications, unlike the CCDB.<br />
<br />
The master RCDB is only modifiable from the counting house. Let's say that you want to update the data stored in a condition for one specific run ([https://halldweb.jlab.org/rcdb/conditions/ here is the list of conditions]). Note that more details and example code can be found on [https://github.com/JeffersonLab/rcdb/wiki the RCDB GitHub pages].<br />
<br />
Below is an example python script that can make this change, with dummy values put in<br />
<pre><br />
import rcdb<br />
from rcdb.model import ConditionType, Condition, Run<br />
<br />
# set up the connection to the master RCDB<br />
db = rcdb.RCDBProvider("mysql://rcdb:<password>@gluondb1/rcdb") # replaced <password> with the master RCDB password<br />
<br />
# update condition "evio_files_count" to NEW_VALUE for a given run number<br />
run = SOME_RUN_NUMBER<br />
db.add_condition(run, "evio_files_count", NEW_VALUE, True)<br />
</pre></div>Sdobbs