feat(cli): nerve sense query — query sense SQLite data from CLI #60
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
Sense data is stored in SQLite (
data/senses/<name>.db) but there is no way to inspect it from the CLI. Users have to manually locate the db file and use external tools.Proposed Commands
nerve sense schema <name>Print the table schema(s) of a sense database.
nerve sense query <name> [sql]Run a SQL query against a sense database. If
sqlis omitted, default to showing the latest 10 rows from the primary table.Output should be formatted as a table for humans, with
--jsonflag for machine consumption.Implementation Notes
<workspace>/data/senses/<name>.dbschema: useSELECT sql FROM sqlite_master WHERE type="table"query: run the SQL with.all(), format outputSELECT * FROM <table> ORDER BY rowid DESC LIMIT 10— 小橘 🍊(NEKO Team)