Skip to content

cockroach-sql: allow invocation via a sql sub-command#80833

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20220429-sql
May 3, 2022
Merged

cockroach-sql: allow invocation via a sql sub-command#80833
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20220429-sql

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Apr 30, 2022

Requested by @ianjevans
Fixes #79850.

We want to simplify tutorials, docs etc by allowing 'cockroach-sql' to
be symlinked to 'cockroach' and ensure that the resulting symlink
still works when invoked as 'cockroach sql' (with a 'sql'
sub-command).

Release note (cli change): The standalone SQL shell executable
cockroach-sql can now be installed (renamed/symlinked) as
cockroach, and invoked via cockroach sql. For example, the
following commands are all equivalent:

$ cockroach-sql -f foo.sql
$ cockroach-sql sql -f foo.sql
after running `ln -s cockroach-sql cockroach`:
$ cockroach sql -f foo.sql

@knz knz requested review from ianjevans and otan April 30, 2022 21:40
@knz knz requested a review from a team as a code owner April 30, 2022 21:40
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there a way we can add a regression test for this behaviour (a la .tcl test or otherwise?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah that would be nice. But it's not easy in this PR because we need new CI rules. Will track in #80921.

We want to simplify tutorials, docs etc by allowing 'cockroach-sql' to
be symlinked to 'cockroach' and ensure that the resulting symlink
still works when invoked as 'cockroach sql' (with a 'sql'
sub-command).

Release note (cli change): The standalone SQL shell executable
`cockroach-sql` can now be installed (renamed/symlinked) as
`cockroach`, and invoked via `cockroach sql`. For example, the
following commands are all equivalent:

```
$ cockroach-sql -f foo.sql
$ cockroach-sql sql -f foo.sql
after running `ln -s cockroach-sql cockroach`:
$ cockroach sql -f foo.sql
```
@knz
Copy link
Copy Markdown
Contributor Author

knz commented May 3, 2022

TFYR

bors r=ianjevans

@craig
Copy link
Copy Markdown
Contributor

craig bot commented May 3, 2022

Build succeeded:

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.

Make a single command to start the SQL client regardless of the binary

4 participants