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

Regexp search supports. #201

Open
hongyi-zhao opened this issue Apr 6, 2024 · 2 comments
Open

Regexp search supports. #201

hongyi-zhao opened this issue Apr 6, 2024 · 2 comments

Comments

@hongyi-zhao
Copy link

Can we let hishtory support regexp-based search?

@ddworken
Copy link
Owner

Hishtory is built on top of sqlite, and sadly, sqlite doesn't support regex by default. Furthermore, since we use modernc.org/sqlite it isn't possible to load sqlite extensions. All of this makes it rather difficult to support regexes. Technically, I think this could be done via a trigram-like approach where we could use sqlite to extract potential matches, and then use a go-based regex to filter those matches. This would work, but performance wouldn't be great.

But I am a bit curious: How important is this feature request in your eyes? If it is rare need, you could just do hishtory export | grep .... Or if this is a common need, I'm curious about what shortcomings you're running into with the default search?

@hongyi-zhao
Copy link
Author

It is not that the regexp search is necessary, and I just say that this will bring greater flexibility.

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

No branches or pull requests

2 participants