You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> CMake sets the required compile definitions (`-DRCDB_SQLITE`, `-DRCDB_MYSQL`) and links
73
+
> the correct libraries automatically based on the `-DWITH_*` options.
86
74
87
75
<br/>
88
76
<br/>
@@ -151,7 +139,7 @@ targets (e.g. `examples_trigger_params`). There is no separate install step or c
151
139
152
140
**List of examples:**
153
141
154
-
*[simple.cpp](https://github.com/JeffersonLab/rcdb/blob/main/cpp/examples/simple.cpp) - Simple condition readout. Note: this example has no CMake target and is not built by `cmake --build build`; compile it manually with `gcc` as shown in the Installation section.
142
+
*[simple.cpp](https://github.com/JeffersonLab/rcdb/blob/main/cpp/examples/simple.cpp)(target `examples_simple`) - Simple condition readout. Used as the introductory build example in the Installation section above.
155
143
*[get_trigger_params.cpp](https://github.com/JeffersonLab/rcdb/blob/main/cpp/examples/get_trigger_params.cpp) (target `examples_trigger_params`) - Versatile data readout example. It includes:
The `rcdb select` command lets you query runs and view condition values directly from the terminal without writing a Python script:
42
+
43
+
```bash
44
+
rcdb select"@is_production and event_count>1000" 30000-31000
45
+
```
46
+
47
+
The first argument is a [selection query](query-syntax), the optional second argument is a run range (`30000-31000`). You can also specify which condition columns to display, use `--dump`/`-d`for an export-friendly output without table borders, and `--desc`/`--asc` to control the sort order:
See [`rcdb-cli`](../rcdb-cli) for the full reference.
54
+
55
+
<br>
56
+
33
57
## Select and filter
34
58
35
59
The fastest designed way to get values from RCDB is by using ```select_values``` function.
@@ -139,26 +163,12 @@ More info about old select runs && get values API: [Select runs & get values DEP
139
163
140
164
<br>
141
165
142
-
## From shell
143
-
(Shell one liner)
144
-
145
-
Suppose one wants to select values in a bash script but doesn't want to create a separate python script.
146
-
It is possible to call ```python -c "semicolon;separated;commands"```
166
+
## Shell one-liner
147
167
148
-
Combining everything in such one-liner:
168
+
For embedding a quick value fetch ina bash script without a separate file, you can also use the Python one-liner form:
149
169
150
170
```bash
151
171
python -c "import rcdb.provider;t=rcdb.provider.RCDBProvider('mysql://rcdb@hallddb.jlab.org/rcdb2').select_values(['polarization_angle','polarization_direction'], run_min=30000, run_max=31000);print('\n'.join([' '.join(map(str, r)) for r in t]))"
152
172
```
153
173
154
-
Shouldn't be there an easier way? There is the ```rcdb select``` command doing it:
155
-
156
-
```bash
157
-
rcdb select"@is_production and event_count>1000" 30000-31000
158
-
```
159
-
160
-
The first argument is a selection query, and the optional second argument is a run range (e.g. ```30000-31000```). You can also pass view columns to display, use ```--dump```/```-d```for an export-friendly output without table borders, and ```--desc```/```--asc``` to control the run number sort order:
0 commit comments