-
Notifications
You must be signed in to change notification settings - Fork 3.9k
cli: extract the SQL connection code to a new package clisqlclient
(2/)
#67457
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
f564f34
to
496f036
Compare
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 to me, but i did not follow the rawHTML
too closely and would argue it'd be worth a separate commit
@@ -0,0 +1,71 @@ | |||
// Copyright 2021 The Cockroach Authors. |
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.
nit: should this be called clierror.go, to match the package name?
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.
There are more files coming to it in later PRs, including an error.go
because there will be an Error
type. That's the "native" one here.
496f036
to
e2fd278
Compare
Thanks for the feedback. I have split that change into a separate commit as requested. RFAL. |
pkg/cli/flags_util.go
Outdated
@@ -323,6 +323,7 @@ const ( | |||
tableDisplayRecords | |||
tableDisplaySQL | |||
tableDisplayHTML | |||
tableDisplayRawHTML |
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.
can you add a comment explaining the difference between rawhtml and html?
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.
Done.
Previously, the cluster setting markdown table was generated with a `gen` sub-command that was trying to be too clever with the HTML generator. This was making it complicated to move the table formatting code to a separate package. This commit simplifies the code by introducing a new output format 'rawhtml' (raw, as in, it does not escape HTML special characters inside table cells). Since this format is only used internally to auto-generate this table, the help texts leave it undocumented. Release note: None
This commit leaves the code in an intermediate stage, where the unit tests pass but maybe the linter is unhappy. This will be cleaned up in the next commit. Release note: None
Release note: None
Release note: None
Release note: None
Release note: None
Release note: None
e2fd278
to
ae9938c
Compare
TFYR! bors r=otan |
Build succeeded: |
67458: cli: some cleanups to the new package `clisqlclient` (3/) r=otan a=knz First 6 commits are from #67457 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 3 commits belong to this PR.. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. 67459: cli: new sub-package `clisqlexec` for the execution/formatting code (4/) r=otan a=knz First 9 commits are from #67458 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 6 commits belong to this PR. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. 67460: cli: move the demo cluster to new sub-package `democluster` (5/) r=otan a=knz First 15 commits are from #67459 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 5 commits belong to this PR. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. 67461: cli: SQL shell cleanups and better encapsulation (6/) r=otan a=knz First 20 commits are from #67460 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 4 commits belong to this PR. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. 67474: cli: new sub-package `clisqlcfg` to ease the creation of a standalone SQL shell (8/) r=otan a=knz First 28 commits are from #67462 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 2 commits belong to this PR. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net>
67458: cli: some cleanups to the new package `clisqlclient` (3/) r=otan a=knz First 6 commits are from #67457 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 3 commits belong to this PR.. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. 67459: cli: new sub-package `clisqlexec` for the execution/formatting code (4/) r=otan a=knz First 9 commits are from #67458 and prior. Please ignore those (they will disappear once the prefix PR is merged) Only the last 6 commits belong to this PR. This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages. Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net>
This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages.