Skip to content

Commit

Permalink
Support a restricted SQL subset for querying timeseries
Browse files Browse the repository at this point in the history
- Add methods for querying oximeter timeseries using a limited subset of
  SQL. The raw string is heavily validated, and only simple SELECT
  queries are currently supported, with a limited subset of ClickHouse
  functions. Still, this allows running many different kinds of queries,
  including aggregations, window functions, and joins.
- Adds a few types for reading out tabular data from the query result,
  and parsing basic metadata for understanding resource usage of the
  queries.
- Add a barebones SQL shell for running oximeter SQL queries, using the
  new `Client::query` method.
- Include a bunch of tests for the restricted SQL subset as well as
  correctness of the actual returned queries against the DB.
- Add a small README for the SQL shell
  • Loading branch information
bnaecker committed Dec 5, 2023
1 parent 7dca6fc commit 3511e0b
Show file tree
Hide file tree
Showing 22 changed files with 2,510 additions and 44 deletions.
157 changes: 143 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ rand = "0.8.5"
ratatui = "0.23.0"
rayon = "1.8"
rcgen = "0.11.3"
reedline = "0.22.0"
ref-cast = "1.0"
regex = "1.10.2"
regress = "0.7.1"
Expand All @@ -310,6 +311,7 @@ rpassword = "7.3.1"
rstest = "0.18.2"
rustfmt-wrapper = "0.2"
rustls = "0.21.9"
rustyline = "12.0.0"
samael = { git = "https://github.com/njaremko/samael", features = ["xmlsec"], branch = "master" }
schemars = "0.8.12"
secrecy = "0.8.0"
Expand Down Expand Up @@ -344,6 +346,7 @@ sp-sim = { path = "sp-sim" }
sprockets-common = { git = "http://github.com/oxidecomputer/sprockets", rev = "77df31efa5619d0767ffc837ef7468101608aee9" }
sprockets-host = { git = "http://github.com/oxidecomputer/sprockets", rev = "77df31efa5619d0767ffc837ef7468101608aee9" }
sprockets-rot = { git = "http://github.com/oxidecomputer/sprockets", rev = "77df31efa5619d0767ffc837ef7468101608aee9" }
sqlparser = { version = "0.36.1", features = [ "visitor" ] }
static_assertions = "1.1.0"
# Please do not change the Steno version to a Git dependency. It makes it
# harder than expected to make breaking changes (even if you specify a specific
Expand Down
Loading

0 comments on commit 3511e0b

Please sign in to comment.