FeatureBaseDB / featurebase

A crazy fast analytical database, built on bitmaps. Perfect for ML applications. Learn more at: http://docs.featurebase.com/. Start a Docker instance: https://hub.docker.com/r/featurebasedb/featurebase
https://www.featurebase.com
Apache License 2.0
2.53k stars 230 forks source link

fbsql: add the `--csv` and `--pset` flags #2342

Closed travisturner closed 1 year ago

travisturner commented 1 year ago

--csv will run in non-interactive mode with csv output --pset=VAR[=ARG] will apply a pset as if you had run \pset var arg

➜  travis/cli/config fbsql --config dax.toml --pset tuples_only=on --csv -c "select * from users"
1,Anne,38
2,Bill,23
3,Cindy,64

@tgruben I think I've addressed the issues you mentioned around csv output, but if not let me know.

There's one little hacky thing I did in this PR to suppress stdout when using the --pset flag. I want to rethink that, but this solution works until I come up with something more elegant. I'm basically gonna wait until I run into the next problem that forces me to address it.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

travisturner commented 1 year ago

I don't have any good test coverage for this and I acknowledge that. I'm not proud of it. I need to add some tests which cover command line flags; so far all of the test coverage applies to meta-commands.