Skip to content

[FR] - Add a CLI history load command #960

@modelorona

Description

@modelorona

Is your feature request related to a problem? Please describe.
The CLI history table shows entry IDs, but there is no command to print the full SQL for a single history entry. Long queries are truncated in history list, so users cannot easily recover one exact query by ID.

Describe the solution you would like
Add a whodb-cli history load [id] command that prints the full query for a history entry. It should support the existing history --format behavior where practical, including plain output for direct shell use and JSON for automation.

Describe alternatives you have considered
Users can search and inspect truncated table output, but that does not reliably recover long or multiline SQL.

Additional context
Starting points:

  • cli/cmd/history.go
  • cli/internal/history/history.go

Acceptance Criteria:

  • whodb-cli history load [id] prints the full query for that entry.
  • Missing IDs return a clear error.
  • JSON output returns the full history entry.
  • Existing history list, history search, and history clear behavior remains unchanged.
  • Focused CLI tests cover the new command.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions