Skip to content

Conversation

@rolandwalker
Copy link
Contributor

@rolandwalker rolandwalker commented Jan 21, 2026

Description

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.

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

  • I've added this contribution to the changelog.md.
  • I've added my name to the AUTHORS file (or it's already there).
  • I ran uv run ruff check && uv run ruff format && uv run mypy --install-types . to lint and format the code.

@rolandwalker rolandwalker self-assigned this Jan 21, 2026
@rolandwalker rolandwalker force-pushed the RW/batch-throttle-option branch from a66566b to f37a0b2 Compare January 22, 2026 10:45
@rolandwalker rolandwalker force-pushed the RW/batch-throttle-option branch 2 times, most recently from 9ed1108 to 8b1da01 Compare January 23, 2026 12:09
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.
@rolandwalker rolandwalker force-pushed the RW/batch-throttle-option branch from 8b1da01 to 8f86e20 Compare January 23, 2026 21:35
Copy link
Contributor

@scottnemes scottnemes left a 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.

@rolandwalker
Copy link
Contributor Author

The intention was not to have it apply to --execute Wouldn't that be a single line anyway?

@rolandwalker rolandwalker merged commit 0145a85 into main Jan 24, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/batch-throttle-option branch January 24, 2026 13:09
@scottnemes
Copy link
Contributor

The intention was not to have it apply to --execute Wouldn't that be a single line anyway?

@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.

@rolandwalker
Copy link
Contributor Author

Hm. We probably should support multiple --execute and run them in series. It seems that we don't.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants