Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom prompt handler should apply even if there is no connection #431

Closed
wants to merge 1 commit into from

Conversation

IceMimosa
Copy link
Contributor

@IceMimosa IceMimosa commented Apr 19, 2021

Custom PromptHandler#getDefaultPrompt may not work when there is no database connection.

@IceMimosa IceMimosa changed the title Fix default prompt where there is no database connection. Fix default prompt when there is no database connection. Apr 19, 2021
@julianhyde
Copy link
Owner

Thanks for the contribution.

For the benefit of people reading this case in future, can you describe what the problem was (i.e. how the prompt looked before you fixed it).

Can you please write a test case. Maybe PromptTest is a good place.

@IceMimosa
Copy link
Contributor Author

Add a unit test, please review. @julianhyde

@julianhyde
Copy link
Owner

Thanks. I have added comments and cleaned up the code. Please review 3f25bfe.

@IceMimosa
Copy link
Contributor Author

LGTM, thanks for your time to support this.

@julianhyde
Copy link
Owner

Currently, the custom prompt handler is ignored until a connection is created; with no connection, prompt is always "sqlline> ". After this change, the prompt handler will kick in even if there is no connection.

Merged as 281b240. Thanks for the PR, @IceMimosa!

@julianhyde julianhyde closed this Apr 21, 2021
@julianhyde julianhyde changed the title Fix default prompt when there is no database connection. Custom prompt handler should apply even if there is no connection Apr 21, 2021
@IceMimosa IceMimosa deleted the fix-some branch April 22, 2021 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants