Calcite CLI is a command-line interface for executing SQL queries using the Calcite server. It provides a prompt where you can enter queries and view the results.
go build
To install Calcite CLI, you can use the following command:
go install github.com/satyakommula96/calcite-cli@latest
After installing Calcite CLI, you can run it using the following command:
calcite-cli [flags]
Flags:
-h, --help help for calcite
-m, --maxRowsTotal string The maxRowsTotal parameter sets the maximum number of rows to return for a given query
--params string Extra parameters for avatica connection (ex: "parameter1=value&...parameterN=value")
-p, --password string The password to use when authenticating against Avatica
-s, --schema string The schema path sets the default schema to use for this connection.
--serialization string Serialization parameter
--url string Connection URL (default "http://localhost:8080")
-u, --username string The user to use when authenticating against Avatica
Once the Calcite CLI prompt starts, you can enter your SQL queries. To exit the prompt, type exit
or quit
.
This project uses the following third-party dependencies:
- github.com/apache/calcite-avatica-go/v5
- github.com/olekukonko/tablewriter
- github.com/spf13/cobra
- github.com/aranjan7/go-prompt
That's the basic usage of the Calcite CLI. You can customize the connection URL and other parameters using command flags.
Happy querying!
This project is licensed under the Apache License. See the LICENSE file for more information.