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

A more intelligent & useful history file & way to query it #1886

Open
6 tasks
kilasuit opened this issue Oct 16, 2020 · 11 comments
Open
6 tasks

A more intelligent & useful history file & way to query it #1886

kilasuit opened this issue Oct 16, 2020 · 11 comments
Assignees
Labels
Area-HistoryImprovements Label for tracking different improvements to history Issue-Enhancement It's a feature request.

Comments

@kilasuit
Copy link

kilasuit commented Oct 16, 2020

It would be great to have a much more intelligent & complex history file than the current simple implementation that we currently have, although to achieve this I expect that it would likely be much more computationally expensive than the current implementation.

Ideally I would like to see this be more structured & complex and able to be queried in a way that allows for much better analytics of common command use that enables inspection on the count of use being aliased or using the full command name, common parameter combinations as well as a count of the use of each parameter & arguments to that parameter.

Some loose goals

  • Local Sqlite file - Default option
  • Remote sqllite or other db format (for cross machine history reasons) - Configurable option
  • Configuration options - including continue to use current file for those that want it
  • Initial base DB Schema
  • User Extensibility of DB Schema
  • Additional Querying cmdlets
@kilasuit kilasuit added the Issue-Enhancement It's a feature request. label Oct 16, 2020
@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Oct 16, 2020
@lzybkr
Copy link
Member

lzybkr commented Oct 16, 2020

Cross session sharing makes this somewhat hard to implement without a proper database.

I see sqlite might be a reasonable option.

@daxian-dbw
Copy link
Member

The suggestion to use Frecency algorithm for history prediction (#1808) and also possibly a local ML model to provide predictions from the history patterns would also require a more powerful storage for history. So yes, we can look into replacing the history file with sqlite.

@daxian-dbw daxian-dbw added Not-Planned and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Oct 30, 2020
@theJasonHelmick theJasonHelmick removed the Issue-Enhancement It's a feature request. label Jan 5, 2021
@daxian-dbw daxian-dbw added this to the 2.2.0-Consider milestone Jan 7, 2021
@daxian-dbw daxian-dbw added Issue-Enhancement It's a feature request. and removed Not-Planned labels Jan 7, 2021
@kilasuit
Copy link
Author

@daxian-dbw This still would be a big win for PSReadline going forward and it would be great if you and I could find some time together to make it happen

@daxian-dbw
Copy link
Member

daxian-dbw commented Apr 10, 2023

I have been wanting to do this, but it just couldn't get in the priority cut due to the limited team resources.
@StevenBucher98 has put this in the 2.3.0 release consideration, and hopefully we will get commitment for this one.

By the way, the Microsoft.Data.Sqlite package looks a good fit for this work.

@kilasuit
Copy link
Author

kilasuit commented Apr 10, 2023

I realise it's not a smallish bit of work to implement especially the more I think about additional configurability options we may want to add. Let me try and carve out some time properly going forward so that I can be of use here (starting with me actually writing some C# after a long long time saying I want to!)

@StartAutomating
Copy link

This looks interesting.

I tackled some of the requests in a proof-of-concept module I made a bit back: https://github.com/StartAutomating/PowerHistory

I'd hope that one of these days, we'd be more willing to accept PowerShell contributions to the PowerShell language.

@claudio-salvio
Copy link

... So yes, we can look into replacing the history file with sqlite.

@daxian-dbw
Perhaps it would be better if both persistence mechanisms were available and users could decide which one to use according to their preference or need.

@StartAutomating
Copy link

@daxian-dbw Perhaps it would be better if both persistence mechanisms were available and users could decide which one to use according to their preference or need.

Maybe, and this might just be crazy talk here, but maybe one could store persistent history in a vault (rather than reinvent a wheel here)

@kilasuit
Copy link
Author

@claudio-salvio This is something that I would look to have as configurable by user with a preference to use the sqlite by default (or other remote db option) but not remove it until a major version if any available module use metrics shows a mass switchover from current implementation.

@kilasuit
Copy link
Author

kilasuit commented Apr 10, 2023

Maybe, and this might just be crazy talk here, but maybe one could store persistent history in a vault (rather than reinvent a wheel here)

I feel that this would be a goal for the longer term but feel that this is loosely captured under configurability options

@lzybkr
Copy link
Member

lzybkr commented Sep 2, 2023

I'd always sort of intended on implementing something here, I'd been thinking about it before this issue was opened.

There are now some options that work across shells. I've been using atuin and it's meeting my needs for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-HistoryImprovements Label for tracking different improvements to history Issue-Enhancement It's a feature request.
Projects
None yet
Development

No branches or pull requests

7 participants