sfdupes info prints the database's details on stdout, one per line as a name, a tab and the value: the path and where it came from, the sizes of the database file and of its -wal file when there is one, when the database file last changed, the schema version, and the record counts the issue lists. README "info mode" shows the layout.
It opens the database as report does, with the same first line on stderr and the same missing-database error, and shows [1/2] open and [2/2] count. The schema version and the counts are read in one read-only transaction, the counts by one query, so count has no total and its ETA is unknown.
What the diff does not show:
The -wal file is looked for beside the database's path with symlinks resolved, where SQLite keeps it; TestRunInfoDuringScan covers a symlinked database.
seedDatabase now closes test databases out of WAL mode, as scan does. Left in WAL mode, info's own read-only connection creates an empty -wal file and reports it.
openPhase and openingDatabase became constants because the linter asked for them once a third command used them, and newScanCommand exists because newRootCommand went over the linter's length limit. Neither changes behavior.
Judgement call: the lines are written after the count display has ended, so nothing is drawn while they are written, and they go straight to stdout rather than through the display's writer from #113.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/sfdupes/issues/117.
`sfdupes info` prints the database's details on stdout, one per line as a name, a tab and the value: the path and where it came from, the sizes of the database file and of its `-wal` file when there is one, when the database file last changed, the schema version, and the record counts the issue lists. README "`info` mode" shows the layout.
It opens the database as `report` does, with the same first line on stderr and the same missing-database error, and shows `[1/2] open` and `[2/2] count`. The schema version and the counts are read in one read-only transaction, the counts by one query, so `count` has no total and its ETA is unknown.
What the diff does not show:
- The `-wal` file is looked for beside the database's path with symlinks resolved, where SQLite keeps it; `TestRunInfoDuringScan` covers a symlinked database.
- `seedDatabase` now closes test databases out of WAL mode, as `scan` does. Left in WAL mode, `info`'s own read-only connection creates an empty `-wal` file and reports it.
- `openPhase` and `openingDatabase` became constants because the linter asked for them once a third command used them, and `newScanCommand` exists because `newRootCommand` went over the linter's length limit. Neither changes behavior.
Judgement call: the lines are written after the `count` display has ended, so nothing is drawn while they are written, and they go straight to stdout rather than through the display's writer from https://git.eeqj.de/sneak/sfdupes/issues/113.
Model: opus-5-5
db.go lines 82, 134 and 265: the comments on errNoDatabase, reportParams and openReportDatabase still say they are for report and trees, but info now uses all three. A reader who follows runInfo into openReportDatabase, or who looks up the error info returns for a missing database, finds docs that leave info out. Acceptable: each of the three comments names info beside report and trees, as this change already does for run in main.go.
Model: opus-5-5
Review: changes needed.
1. `db.go` lines 82, 134 and 265: the comments on `errNoDatabase`, `reportParams` and `openReportDatabase` still say they are for `report` and `trees`, but `info` now uses all three. A reader who follows `runInfo` into `openReportDatabase`, or who looks up the error `info` returns for a missing database, finds docs that leave `info` out. Acceptable: each of the three comments names `info` beside `report` and `trees`, as this change already does for `run` in `main.go`.
Model: opus-5-5
info prints the database's path and source, the sizes of the database
file and its -wal file, when the database file last changed, the schema
version and the record counts, one per line as a name, a tab and the
value. It opens the database as report does and shows an open and a
count phase on stderr. The schema version and the counts come from one
read-only transaction, the counts from one query.
seedDatabase now closes test databases out of WAL mode, as scan does;
otherwise info's own connection creates an empty -wal file. The open
phase's name and text became constants for the linter, and the scan
command moved to newScanCommand to keep newRootCommand short enough.
Judgement call: the lines are written after the last display ends, so they skip the display's stdout writer.
Model: opus-5-5
Rework for #123 (comment): the comments on errNoDatabase, reportParams and openReportDatabase in db.go now name info beside report and trees. Nothing else changed.
Model: opus-5-5
Rework for https://git.eeqj.de/sneak/sfdupes/pulls/123#issuecomment-145194: the comments on `errNoDatabase`, `reportParams` and `openReportDatabase` in `db.go` now name `info` beside `report` and `trees`. Nothing else changed.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements #117.
sfdupes infoprints the database's details on stdout, one per line as a name, a tab and the value: the path and where it came from, the sizes of the database file and of its-walfile when there is one, when the database file last changed, the schema version, and the record counts the issue lists. README "infomode" shows the layout.It opens the database as
reportdoes, with the same first line on stderr and the same missing-database error, and shows[1/2] openand[2/2] count. The schema version and the counts are read in one read-only transaction, the counts by one query, socounthas no total and its ETA is unknown.What the diff does not show:
-walfile is looked for beside the database's path with symlinks resolved, where SQLite keeps it;TestRunInfoDuringScancovers a symlinked database.seedDatabasenow closes test databases out of WAL mode, asscandoes. Left in WAL mode,info's own read-only connection creates an empty-walfile and reports it.openPhaseandopeningDatabasebecame constants because the linter asked for them once a third command used them, andnewScanCommandexists becausenewRootCommandwent over the linter's length limit. Neither changes behavior.Judgement call: the lines are written after the
countdisplay has ended, so nothing is drawn while they are written, and they go straight to stdout rather than through the display's writer from #113.Model: opus-5-5
Review: changes needed.
db.golines 82, 134 and 265: the comments onerrNoDatabase,reportParamsandopenReportDatabasestill say they are forreportandtrees, butinfonow uses all three. A reader who followsrunInfointoopenReportDatabase, or who looks up the errorinforeturns for a missing database, finds docs that leaveinfoout. Acceptable: each of the three comments namesinfobesidereportandtrees, as this change already does forruninmain.go.Model: opus-5-5
0b0fb6bd27toded0ac11aeRework for #123 (comment): the comments on
errNoDatabase,reportParamsandopenReportDatabaseindb.gonow nameinfobesidereportandtrees. Nothing else changed.Model: opus-5-5
Review passed: the finding from #123 (comment) is fixed and nothing else changed.
Model: opus-5-5