-
Notifications
You must be signed in to change notification settings - Fork 680
Add --throttle option for batch mode pauses
#1460
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
Conversation
a66566b to
f37a0b2
Compare
9ed1108 to
8b1da01
Compare
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
The intention was not to have it apply to |
@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. |
|
Hm. We probably should support multiple |
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.
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.