CLI: Add REPL support to CLI#4465
Conversation
There was a problem hiding this comment.
LGTM 👍 Thanks, @MonkeyCanCode !
I tested it briefly... it works :) but it's a bit awkward .... for example create namespace requires a --catalog option. It would be nicer to be able to start repl --catalog polaris and not have to provide the catalog option inside the REPL 🙂
flyrain
left a comment
There was a problem hiding this comment.
Thanks for adding this, @MonkeyCanCode! It's pretty cool after trying. It's great that we don't have to re-typing credentials or profiles.
Overall, I think it is a good start point. It is a one-liner command now. We could add more context later, for example, adding a catalog as a context, as @dimas-b pointed out, similar to a typical sql repl, use catalog to set the current catalog, etc.
Good thinking and better UX as well. I will add this change soon. |
dimas-b
left a comment
There was a problem hiding this comment.
I meant to approve in my previous review 😅
From my POV it's fine to merge this PR and improve later.
All good. All feedbacks are addressed now. Do you mind take another look? |
| from typing import Optional | ||
| from cmd import Cmd | ||
|
|
||
| try: |
There was a problem hiding this comment.
For the record, this is due to windows doesn't support readline (found this while play on my windows. ref: https://stackoverflow.com/questions/51157443/pythons-readline-module-not-available-for-windows). If we need to get this working on Windows, we can add pyreadline3 as suggested in the stackoverflow page as well. @flyrain @dimas-b
flyrain
left a comment
There was a problem hiding this comment.
+1. The feature is pretty cool. Thanks a lot for adding it, @MonkeyCanCode .
| from typing import Optional | ||
| from cmd import Cmd | ||
|
|
||
| try: |
This is second time where we got asked to support REPL (https://lists.apache.org/thread/mgfo0vyxjqb47bkp09d2gw8162f3n2kw). This PR adds the REPL support for Polaris CLI.
Sample outputs:
Start REPL session via host/port/client-id/client-secret:
Start REPL session via profile:
Top level help:
Help command on another command:
Help option from command
Create a new principal:
List all principals:
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)