8000 cli: extract the SQL connection code to a new package `clisqlclient` (2/) by knz · Pull Request #67457 · cockroachdb/cockroach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 7 commits into from
Jul 14, 2021

Conversation

knz
Copy link
Contributor
@knz knz commented Jul 10, 2021

This is part of a family of PRs that aim to encapsulate CLI functionality into finer grained packages.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz knz requested a review from jbowens July 10, 2021 10:59
@knz knz marked this pull request as ready for review July 10, 2021 10:59
@knz knz requested a review from a team July 10, 2021 10:59
@knz knz requested review from a team as code owners July 10, 2021 10:59
@knz knz requested review from a team and adityamaru and removed request for a team July 10, 2021 10:59
@knz knz force-pushed the 20210705-cli-refactor2 branch 2 times, most recently from f564f34 to 496f036 Compare July 12, 2021 09:02
Copy link
Contributor
@otan otan 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 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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@knz knz force-pushed the 20210705-cli-refactor2 branch from 496f036 to e2fd278 Compare July 13, 2021 17:22
@blathers-crl blathers-crl bot requested a review from otan July 13, 2021 17:22
@knz
Copy link
Contributor Author
knz commented Jul 13, 2021

i did not follow the rawHTML too closely and would argue it'd be worth a separate commit

Thanks for the feedback. I have split that change into a separate commit as requested. RFAL.

@@ -323,6 +323,7 @@ const (
tableDisplayRecords
tableDisplaySQL
tableDisplayHTML
tableDisplayRawHTML
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

knz added 7 commits July 14, 2021 13:03
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
@knz knz force-pushed the 20210705-cli-refactor2 branch from e2fd278 to ae9938c Compare July 14, 2021 11:10
@knz
Copy link
Contributor Author
knz commented Jul 14, 2021

TFYR!

bors r=otan

@craig
Copy link
Contributor
craig bot commented Jul 14, 2021

Build succeeded:

@craig craig bot merged commit 162a1d4 into cockroachdb:master Jul 14, 2021
craig bot pushed a commit that referenced this pull request Jul 14, 2021
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>
@knz knz deleted the 20210705-cli-refactor2 branch July 14, 2021 12:32
craig bot pushed a commit that referenced this pull request Jul 14, 2021
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>
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
0