Add --throttle option for batch mode pauses#1460
Merged
rolandwalker merged 1 commit intomainfrom Jan 24, 2026
Merged
Conversation
a66566b to
f37a0b2
Compare
9ed1108 to
8b1da01
Compare
scottnemes
reviewed
Jan 23, 2026
The --throttle option adds a pause between queries in batch mode, which can be useful for long or intensive scripts. Technically we pause between each line of input, which is usually equivalent to one query.
8b1da01 to
8f86e20
Compare
scottnemes
approved these changes
Jan 23, 2026
Contributor
scottnemes
left a comment
There was a problem hiding this comment.
Looks good!
Follow-up question; you aren't intending for this to work with the -e option right? Think by batch you mean the piping in (mycli < test.sql), but wanted to verify you didn't want it to work for -e executing too.
Contributor
Author
|
The intention was not to have it apply to |
Contributor
@rolandwalker Could be multiple queries from -e or from the prompt even. However I wasn't suggesting you should do that, just clarifying your goals for the feature. |
Contributor
Author
|
Hm. We probably should support multiple |
rolandwalker
added a commit
that referenced
this pull request
Jan 24, 2026
and run each specified query in turn. The current behavior is to accept multiple --execute options, but to only execute the last one: a bug. Since there are multiple values, we can also support --throttle, per the discussion in #1460. One inconsistency between STDIN and --execute is that --execute does not support warning on destructive queries. This should probably be resolved in the direction of removing the warning from scripts on STDIN.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
--throttleoption adds a pause between queries in batch mode, which can be useful for long or intensive scripts.Technically we pause between each line of input, which is usually equivalent to one query.
To reduce conflicts, this branch is based off of #1450 , and will need to be rebased once that is merged. There's no need to review until that is done.Rebased.Checklist
changelog.md.AUTHORSfile (or it's already there).uv run ruff check && uv run ruff format && uv run mypy --install-types .to lint and format the code.