Skip to content

cli: unable to specify separate SQL and gRPC port via static environment variables #102349

Open
@1lann

Description

@1lann

With the release of 22.2, having a unified SQL and gRPC port has been deprecated, thus in our cloud deployments we use separated SQL and gRPC ports. However it currently isn't possible to be able to specify with static environment variables what ports cockroach CLI commands should use.

For example, if I want to access SQL shell I would have to do
COCKROACH_URL="postgresql://[email protected]:26257" cockroach sql
but in order to take a debug zip with a gRPC port listening on 26258 it would be
COCKROACH_URL="postgresql://[email protected]:26258" cockroach debug zip ./debug.zip

It's also sometimes not obvious what commands use the gRPC port vs what commands use the SQL port (maybe there are some that use both?). So far my current workaround has been to write a wrapper that replaces the environment variable depending on the command used but this isn't ideal.

It would be good if I didn't need to worry about that and am able to set a static environment variable for gRPC use, preferably in the form of a separate URL, like COCKROACH_GRPC_URL.

Jira issue: CRDB-27406

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cli-clientCLI commands that pertain to using SQL featuresA-cli-flagsPertains to CLI flag handling common to all CLI commandsC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions