Upsolver CLI is the next-generation command line client that provides a terminal-based interactive shell for running queries. It connects to Upsolver to execute SQL statements and perform all DDL and DML operations, including loading data as a continuous stream to various data destinations.
Upsolver CLI provides a command line interface to interact with the Upsolver API endpoint. The CLI connects to a Upsolver service and interacts with it through the service's endpoint.
- 1.Ordinary API requests where a request is submitted and the response is received completely. In this case, the Upsolver prompt in the CLI shows the response as well as the prompt to receive the next request/command from the user.
- 2.Streaming requests where the response is an unbounded stream of data that is sent by the Upsolver service. This type of response is generated for
INSERTstatements. They can be terminated by dropping the job.
A connection is not a prerequisite for installing Upsolver CLI. All required software for installing Upsolver CLI is bundled in the installers.
Upsolver provides platform-specific versions of Upsolver CLI for download for the following platforms:
You can install the CLI tool using Homebrew:
$ brew tap upsolver/cli https://github.com/Upsolver/cli
$ brew install upsolver-cli
Make sure you have Python 3.10+ installed, and then use pip to install the CLI tool:
Lines are read one at a time and are sent as Upsolver CLI unless one of the following is true:
- 1.The line is empty or entirely whitespace. In this case, no request is made.
- 2.The line is not a built-in CLI command and does not end with a semicolon. In this case, the CLI enters multi-line mode where lines are continuously read until a line is encountered that is terminated with a semicolon. The concatenation of all lines read during this time is sent as Upsolver CLI.
upsolver configureto authenticate.
% upsolver configure
API Access Token [5fcf1025c6e2413db4fa32dc23227d5b]: 5fcf1025c6e2413db4fa32dc23227d5b
API Endpoint [https://api-d1231eb0-456d-4708-a393-6be41a770722.upsolver.com]: https://api-d1231eb0-456d-4708-a393-6be41a770722.upsolver.com
Default Output Format [json]: json
The configuration profile will be located under
~/.upsolver/configYou may have multiple profiles defined if multiple accounts are needed.
token = 5fcf1025c6e2413db4fa32dc23227d5b
base_url = https://api-d1231eb0-456d-4708-a393-6be41a770722.upsolver.com
output = JSON
token = 3fcf1025c6e1234db4fa32dc5678d5b
base_url = https://api-d4321eb0-456d-4708-a393-6be41a123455.upsolver.com
output = JSON
In the example above, you may use
upsolver -p susie catalogs lsto run statements using a specific profile.
$ upsolver clusters ls
"name": "Private API",
"name": "Default Compute",
"name": "Default Query",