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

Feature request: output number of ignored/replaced rows for insert command #516

Open
simonw opened this issue Dec 6, 2022 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Dec 6, 2022

https://hachyderm.io/@briandorsey/109468185742876820

I'm fiddling with piping json to insert -ignore I'd love to see the count of records inserted & ignored, but didn't see a way to do that in the help/docs.

Example: xh "https://hachyderm.io/api/v1/timelines/tag/rust?max_id=109443380308326328" | sqlite-utils insert aoc.db aoc - --pk=id --ignore

@simonw simonw added the enhancement New feature or request label Dec 6, 2022
@simonw
Copy link
Owner Author

simonw commented Dec 6, 2022

Right now the command produces no output at all.

Maybe a --verbose mode that writes these numbers to standard error (or even standard output since it's an option)?

Is there a better name than --verbose for this? --summary perhaps?

@briandorsey
Copy link

--verbose or --verbosity=ABC were the flags I looked for. Expected to see them at a global level near --version. But only sharing because that's where I looked first, I don't have a strong opinion on the exact wording/location.

@briandorsey
Copy link

Current behavior is different when importing via stdin vs. a file. Imports from a file give a progress bar. For this new request, I'd love to see total imported and total ignored/replaced in both cases.

@briandorsey
Copy link

Reference: tqdm (https://tqdm.github.io/) shows a progress bar when total is known, and falls back to counting units of work done for streams. File input vs. stdin seems like a similar situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants