Fix history file usage in SQL CLI tool. #155
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Yury-Fridlyand yuryf@bitquilltech.com
Description
Changes include:
FileHistory
.history_file
andlog_file
parameters from config.Config location:
~/.config/opensearchsql-cli/config
Default location for saving history and log files:
~/.config/opensearchsql-cli
Inspired by: https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/examples/prompts/history/persistent-history.py
Test
venv
(see instructions below)How to test
Ref: https://github.com/opensearch-project/sql/blob/2.x/sql-cli/development_guide.md#development-environment-set-up
Do once:
Then every time you want to debug SQL CLI:
To exit from
venv
:You can run SQL CLI and switch branch. It will keep working with given timeout until closed.
Issues Resolved
Query history didn't persist across SQL CLI runs.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.