cli: support -f to read SQL from a file#54741
Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom Sep 24, 2020
Merged
Conversation
This makes it easier to process a file other than the standard input. Release note: None
Member
irfansharif
approved these changes
Sep 24, 2020
pkg/cli/cliflags/flags.go
Outdated
| results of each SQL statement are printed on the standard output.`, | ||
| results of each SQL statement are printed on the standard output. | ||
|
|
||
| This flag is incompatible with --input-file / -f.`, |
Contributor
There was a problem hiding this comment.
I don't have an alternative, but is input-file used in other CLIs? The -f feels familiar+intuitive, the --input-file doesn't as much (partly because it doesn't start with an f).
Contributor
Author
|
psql uses |
Release note (cli change): `cockroach sql` and `cockroach demo` now support the command-line parameter `--input-file` (shorthand `-f`) to read commands from a named file. The behavior is the same as if the file was redirected on the standard input; in particular, the processing stops at the first error encountered (which is different from interactive usage with a prompt). Note that it is not (yet) possible to combine `-f` with `-e`.
Contributor
Author
|
bors r=irfansharif |
Contributor
|
Build failed (retrying...): |
Contributor
|
Build succeeded: |
craig bot
pushed a commit
that referenced
this pull request
Sep 24, 2020
54261: ui: add transactions page to Admin UI r=dhartunian a=elkmaster This commit adds the new Transactions Page to the Admin UI. This page is much like the Statements Page but differs in that it shows Transaction-level statistics in tabular and detail form. Every Transaction is able to display its contained Statements for more detailed analysis. The page and its components are imported from the `admin-ui-components` library. Depends on: cockroachdb/yarn-vendored#38 Release justification: low-risk high impact addition to Admin UI Release note (admin ui change): add Transactions and Transactions details pages. These pages allow for viewing stats at the transaction level. 54749: cli/demo: provision an initial non-`root` "demo" user r=irfansharif a=knz Fixes #54557. Requested by @jseldess First 2 commits from #54741 (can be ignored during review) Release note (cli change): `cockroach demo` now pre-creates a `demo` user account with a random password, instead of letting (and encouraging) the user to use the `root` account directly. The `demo` account is currently granted the `admin` role. 54755: sql: fix bug whereby backfiller would drop spans on txn restart r=ajwerner a=ajwerner This bug was caught by testing with #54695. Before that change, it would fail almost immediately, now it does not fail under stress. I'm open to suggestions on how to more generally test this. Release note (bug fix): Fixed a rare bug which can lead to index backfills failing in the face of transaction restarts. Co-authored-by: Vlad <carrott9@gmail.com> Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net> Co-authored-by: Andrew Werner <ajwerner@cockroachlabs.com>
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.
Fixes #42955
Release note (cli change):
cockroach sqlandcockroach demonowsupport the command-line parameter
--input-file(shorthand-f) toread commands from a named file. The behavior is the same as if the
file was redirected on the standard input; in particular, the
processing stops at the first error encountered (which is different
from interactive usage with a prompt).
Note that it is not (yet) possible to combine
-fwith-e.