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

Persistent history #23

Merged
merged 13 commits into from
Nov 23, 2017
Merged

Persistent history #23

merged 13 commits into from
Nov 23, 2017

Conversation

dundalek
Copy link
Owner

@dundalek dundalek commented Nov 7, 2017

Work in Progress

Tasks:

  • Save history into sqlite
  • Load up history into readline memory
  • Type something then arrow up search
  • Ctrl-r search
  • Do not load history into memory (search via db)
  • Cleanups & testing

@mnewt
Copy link
Contributor

mnewt commented Nov 7, 2017

Cool. This sure will come in handy during development, when the repl is constantly restarting. I'm curious what your plans are with this. What is sqlite adding to the equation? Why not simply read a file into memory and then search in memory?

@dundalek
Copy link
Owner Author

dundalek commented Nov 7, 2017

Good question! The design goal I have is to get to feature completeness as soon as possible with reasonable trade-offs. The most difficult part with keeping history is synchronizing writes of multiple processes (when you have multiple shells running) into one file. You have to do low-level file locking, which may behave slightly differently across different platforms. Sqlite does its own robust file locking which makes it easy for us.

@dundalek dundalek merged commit 7ba9cd6 into master Nov 23, 2017
@dundalek dundalek deleted the feature/history branch November 30, 2017 11:27
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