featurebase/dax
Travis Turner 87011e4294
CLI: make it more like psql (#2235)
* Refactor CLI to mimic psql's meta-commands

This PR adds support for meta-commands (also known as "backslash
commands") like those in psql, Postgres's CLI. Only a few meta-commands
are currently implemented, but this was meant to demonstrate how we
could use something like `\i file.csv` to insert local files into SQL
statements.

* Meta-commands: \file and \include

The initial implementation used `\i` as a streaming file handle.

This commit changes that to `\file`, and then implements `\i` (or
`\include`) as handling multiple sql commands.

* Add meta-command "help" (\?)

This is basically a copy of the psql help output, but includes only
those options we currently support.

* Add support for \o [file], and \timing

The \o meta-command writes query output to a file.

The \timing meta-command turns on/off the timing display sent to stdout.

* Add meta-commands: \l (show databases) and \dt (show tables)

* Add meta-command: \watch [period]

* Update meta-command \connect to take database name instead of ID

* Add support for \echo, \qecho, and \warn

This commit contains an known issue in that the `-n` option will exclude
the line feed, but if the output is the terminal, the readline package
clobbers any content on the current line (i.e. anything without a line
feed). That will need to be addressed at some point.

* Add support for \w [FILE] (write query buffer to file)

* Add SchemaAPI no-op implementation

* Refactor query handler to align with /sql and /databases endpoints

We want to standardize on:
/sql
/databases/{databaseID}/sql

* Add CLI support for expanded, border, tuples_only (and pset)

* Add help text for \pset and \t
2023-02-14 09:23:51 -06:00
..
boltdb Add Drop Database and Drop Table support (#2208) 2023-01-23 19:59:47 -06:00
computer tweak a bunch of logging and config (#2234) 2023-02-03 14:59:07 -06:00
controller CLI: make it more like psql (#2235) 2023-02-14 09:23:51 -06:00
http Remove MDS and replace it with Controller (#2219) 2023-01-30 16:54:12 -06:00
queryer CLI: make it more like psql (#2235) 2023-02-14 09:23:51 -06:00
server tweak a bunch of logging and config (#2234) 2023-02-03 14:59:07 -06:00
snapshotter Add Drop Database and Drop Table support (#2208) 2023-01-23 19:59:47 -06:00
storage Support for setting individual DatabaseOptions (#2231) 2023-02-06 08:50:28 -06:00
test CLI: make it more like psql (#2235) 2023-02-14 09:23:51 -06:00
writelogger Support for setting individual DatabaseOptions (#2231) 2023-02-06 08:50:28 -06:00
address.go Database isolation: Balancer (#2407) 2023-01-19 22:10:08 +00:00
address_test.go Sync from private repo to commit 12d608c80d 2022-12-12 09:01:20 -08:00
controller.go Add Drop Database and Drop Table support (#2208) 2023-01-23 19:59:47 -06:00
dax.go Remove MDS and replace it with Controller (#2219) 2023-01-30 16:54:12 -06:00
directive.go Remove MDS and replace it with Controller (#2219) 2023-01-30 16:54:12 -06:00
docker-compose.yml Remove MDS and replace it with Controller (#2219) 2023-01-30 16:54:12 -06:00
errors.go Add Drop Database and Drop Table support (#2208) 2023-01-23 19:59:47 -06:00
Makefile Remove MDS and replace it with Controller (#2219) 2023-01-30 16:54:12 -06:00
node.go Add Drop Database and Drop Table support (#2208) 2023-01-23 19:59:47 -06:00
README.md introduce performance counters and system table fanout, plus refactor metrics (#2363) 2023-01-19 21:35:02 +00:00
role.go Database isolation: Balancer (#2407) 2023-01-19 22:10:08 +00:00
schema.go Support for setting individual DatabaseOptions (#2231) 2023-02-06 08:50:28 -06:00
service_manager.go tweak a bunch of logging and config (#2234) 2023-02-03 14:59:07 -06:00
snapshot.go remove version/directive stuff from other snapshot endpoints 2023-01-10 23:22:58 +00:00
table.go Support for setting individual DatabaseOptions (#2231) 2023-02-06 08:50:28 -06:00
table_test.go Support for setting individual DatabaseOptions (#2231) 2023-02-06 08:50:28 -06:00
time.go Add DAX - full list of squashed commits below 2022-12-12 09:01:20 -08:00
transaction.go Database isolation: Balancer (#2407) 2023-01-19 22:10:08 +00:00
versioned_partition.go first cut at removing all the shard/field/partition versioning 2023-01-10 23:27:40 +00:00
versioned_shard.go first cut at removing all the shard/field/partition versioning 2023-01-10 23:27:40 +00:00
workerjob.go Database isolation: Balancer (#2407) 2023-01-19 22:10:08 +00:00
workerjob_test.go Add DAX - full list of squashed commits below 2022-12-12 09:01:20 -08:00

DAX

DAX encapsulates anything which covers all of the services which make up the "disaggregation of storage and compute" project. Initially, this will include integration tests which pull in things like Metadata Services (MDS), including the Controller, as well as FeatureBase and IDK-based ingesters.

Setting up the tests

The DAX test currently requires docker images for: featurebase and datagen.

If at any point you run into problems with go mod failing to reference a private repo, make sure that you have gitlab.com/featurebasedb in your GOPRIVATE environment variable.

Note that during the docker image build step, go mod vendor is run, which creates a vendor directory in the root directory, and copies that to docker during the build stage. Just be aware of this; you may want to remove that vendor directory after you're done building docker images.

Possible Configuruation

The following were relevent when the dax code was in a separate repository. These may no longer be relevant.

I needed to but this in my ~/.profile file:

export GOPRIVATE=github.com/featurebasedb,gitlab.com/featurebasedb

And this in my ~/.gitconfig

[url "ssh://git@github.com/"]
	insteadOf = https://github.com/
[url "ssh://git@gitlab.com/"]
	insteadOf = https://gitlab.com/

Then make docker ran successfully.

Build the FeatureBase docker image

  • Check out the dax branch of the featurebase repository.
  • Run make docker-image-featurebase to build the docker image
  • You should now have an image in docker named dax/featurebase with the tag latest.

Build the Datagen docker image

  • cd <featurebase_repo_root>/idk
  • Run make docker-image-datagen to build the docker image
  • You should now have an image in docker named dax/datagen with the tag latest.

Running the tests

  • Check out the dax branch of the featurebase repository.
  • Change into the dax directory: cd dax
  • Run make test-integration.