Skip to content

Commit

Permalink
readme update (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
satyakommula96 authored Oct 15, 2023
1 parent 1f3f2cf commit 6962965
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
20 changes: 14 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ go build
To install Calcite CLI, you can use the following command:

```
go get github.com/satyakommula96/calcite-cli
go install github.com/satyakommula96/calcite-cli@latest
```

## Usage
Expand All @@ -47,19 +47,27 @@ calcite-cli [flags]


Flags:
- `--url`: Connection URL to the Calcite server (default: http://localhost:8080)
- `--serialization`: Serialization parameter (default: protobuf)
- `--enablePartitionPruning`: Enable Partition Pruning (default: true)
- `--distributedExecution`: Distributed Execution (default: false)
```commandline
Once the Calcite CLI prompt starts, you can enter your SQL queries. To exit the prompt, type `exit`.
-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`.

## Dependencies

This project uses the following third-party dependencies:
- [github.com/apache/calcite-avatica-go/v5](https://github.com/apache/calcite-avatica-go/v5)
- [github.com/olekukonko/tablewriter](https://github.com/olekukonko/tablewriter)
- [github.com/spf13/cobra](https://github.com/spf13/cobra)
- [github.com/aranjan7/go-prompt](https://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.

Expand Down
8 changes: 4 additions & 4 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ func main() {
// Define flags for connection URL and additional parameters
rootCmd.Flags().StringVar(&connectionURL, "url", connectionURL, "Connection URL")
rootCmd.Flags().StringVar(&serialization, "serialization", "", "Serialization parameter")
rootCmd.Flags().StringVar(&connectionParams, "params", "", "Extra parameters for avatica connection (ex: property=value&property=value)")
rootCmd.Flags().StringVar(&connectionParams, "params", "", "Extra parameters for avatica connection (ex: \"parameter1=value&...parameterN=value\")")
rootCmd.Flags().StringVarP(&schema, "schema", "s", "", "The schema path sets the default schema to use for this connection.")
rootCmd.Flags().StringVarP(&user, "username", "u", "", "Username (required if password is set)")
rootCmd.Flags().StringVarP(&passwd, "password", "p", "", "Password (required if username is set)")
rootCmd.Flags().StringVarP(&user, "username", "u", "", "The user to use when authenticating against Avatica")
rootCmd.Flags().StringVarP(&passwd, "password", "p", "", "The password to use when authenticating against Avatica")
rootCmd.MarkFlagsRequiredTogether("username", "password")
rootCmd.Flags().StringVarP(&maxRowsTotal, "maxRowsTotal", "m", "", "Serialization parameter")
rootCmd.Flags().StringVarP(&maxRowsTotal, "maxRowsTotal", "m", "", "The maxRowsTotal parameter sets the maximum number of rows to return for a given query")

err := rootCmd.Execute()
if err != nil {
Expand Down

0 comments on commit 6962965

Please sign in to comment.