-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add support for executing SQL statements from the command line. #3979
Conversation
LGTM Reviewed 4 of 4 files at r1. Comments from the review on Reviewable.io |
Nice, be the change you're looking for. Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. cli/cli_test.go, line 475 [r1] (raw file): cli/cli_test.go, line 483 [r1] (raw file): cli/flags.go, line 156 [r1] (raw file): cli/flags.go, line 264 [r1] (raw file):
cli/sql.go, line 142 [r1] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 5 unresolved discussions. cli/cli_test.go, line 475 [r1] (raw file): cli/cli_test.go, line 483 [r1] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 5 unresolved discussions. cli/cli_test.go, line 475 [r1] (raw file): cli/cli_test.go, line 483 [r1] (raw file): Comments from the review on Reviewable.io |
Review status: 1 of 5 files reviewed at latest revision, 3 unresolved discussions. cli/flags.go, line 156 [r1] (raw file): cli/flags.go, line 264 [r1] (raw file): cli/sql.go, line 142 [r1] (raw file): Comments from the review on Reviewable.io |
LGTM Review status: 1 of 5 files reviewed at latest revision, 4 unresolved discussions. cli/cli_test.go, line 483 [r2] (raw file): cli/context.go, line 2 [r2] (raw file): cli/sql.go, line 147 [r2] (raw file): cli/sql.go, line 169 [r2] (raw file): Comments from the review on Reviewable.io |
Review status: 0 of 5 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. cli/cli_test.go, line 483 [r2] (raw file): cli/context.go, line 2 [r2] (raw file): cli/sql.go, line 169 [r2] (raw file): Comments from the review on Reviewable.io |
Review status: 0 of 5 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. cli/context.go, line 1 [r3] (raw file): Comments from the review on Reviewable.io |
Reviewed 3 of 5 files at r2, 3 of 3 files at r3. cli/cli_test.go, line 482 [r3] (raw file): cli/cli_test.go, line 489 [r3] (raw file): cli/context.go, line 42 [r3] (raw file): cli/flags.go, line 261 [r3] (raw file): cli/sql.go, line 147 [r2] (raw file): cli/sql.go, line 43 [r3] (raw file): cli/sql.go, line 79 [r3] (raw file): cli/sql.go, line 134 [r3] (raw file): cli/sql.go, line 137 [r3] (raw file): cli/sql.go, line 150 [r3] (raw file): cli/sql.go, line 159 [r3] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 12 unresolved discussions, some commit checks failed. cli/cli_test.go, line 482 [r3] (raw file): cli/cli_test.go, line 489 [r3] (raw file): cli/context.go, line 42 [r3] (raw file): cli/flags.go, line 261 [r3] (raw file): cli/sql.go, line 147 [r2] (raw file): cli/sql.go, line 43 [r3] (raw file): cli/sql.go, line 79 [r3] (raw file): cli/sql.go, line 134 [r3] (raw file): cli/sql.go, line 137 [r3] (raw file): cli/sql.go, line 150 [r3] (raw file): cli/sql.go, line 159 [r3] (raw file): Comments from the review on Reviewable.io |
@tamird re the tabwriter question. A tabwriter does not make any sense: the purpose of this output format is to machine-parsable, and for this you want a single character as delimiter. It does not matter that it aligns well for the human observer. There is a case to be made to allow multiple output formats in there, with or without proper escaping of strings, but I gather we can issue a separate PR to extend in this direction and the current form is probably OK for Beta. |
Review status: 4 of 5 files reviewed at latest revision, 12 unresolved discussions. cli/context.go, line 1 [r3] (raw file): Comments from the review on Reviewable.io |
Review status: 4 of 5 files reviewed at latest revision, 12 unresolved discussions. cli/sql.go, line 79 [r3] (raw file): cli/sql.go, line 159 [r3] (raw file): Comments from the review on Reviewable.io |
With this patch the user can use "sql -e ..." to execute statements, print their results and exit, without an interactive prompt. Fixes cockroachdb#3817
Add support for executing SQL statements from the command line.
Reviewed 1 of 2 files at r4. cli/context.go, line 42 [r3] (raw file): cli/flags.go, line 261 [r3] (raw file): cli/sql.go, line 147 [r2] (raw file): cli/sql.go, line 134 [r3] (raw file): Comments from the review on Reviewable.io |
With this patch the user can use "sql -e ..." to execute statements,
print their results and exit, without an interactive prompt.
Fixes #3817