-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli/sql: support for client-side \o
#83118
Conversation
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.
nice. just had some testing comments
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @knz and @otan)
pkg/cli/interactive_tests/test_local_cmds.tcl
line 272 at r1 (raw file):
send "\\o logs/query-output.txt\r" eexpect root@ send "select 'hello world';\r"
does the output appear in the CLI as well (like tee
)? if so, add a test for that
also, perhaps add a test to see how query syntax/execution errors are redirected to that file
pkg/cli/interactive_tests/test_local_cmds.tcl
line 283 at r1 (raw file):
eexpect "hello" eexpect root@ end_test
nit: test qecho
as well
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @otan and @rafiss)
pkg/cli/interactive_tests/test_local_cmds.tcl
line 272 at r1 (raw file):
does the output appear in the CLI as well (like tee)?
nope
also, perhaps add a test to see how query syntax/execution errors are redirected to that file
they're not (like in psql), but good point to test. Done.
pkg/cli/interactive_tests/test_local_cmds.tcl
line 283 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
nit: test
qecho
as well
Good point. Done.
Release note (cli change): `cockroach sql` (and thus `cockroach demo` too) now support the client-side commands `\o` and `\qecho` like `psql`. The command `\o` can redirect the output of SQL queries to a file. `\qecho` adds an arbitrary text to the current query output file.
RFAL |
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 great!
Reviewed 6 of 7 files at r1, 1 of 1 files at r3, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @otan and @rafiss)
thanks! bors r=rafiss |
Build failed: |
unrelated flake bors r=rafiss |
Build succeeded: |
Release note (cli change):
cockroach sql
(and thuscockroach demo
too) now support the client-side commands
\o
and\qecho
likepsql
. The command\o
can redirect the output of SQL queries to afile.
\qecho
adds an arbitrary text to the current query output file.