Skip to content
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

sql,cli/sql: session var + display the tenant name in the SQL shell regardless of conn string #111491

Closed
knz opened this issue Sep 29, 2023 · 0 comments · Fixed by #111566
Closed
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-multitenant Issues owned by the multi-tenant virtual team

Comments

@knz
Copy link
Contributor

knz commented Sep 29, 2023

Is your feature request related to a problem? Please describe.

Requested by @amruss and @ajstorm : it would be useful to display the tenant name in the SQL shell irrespective of whether it was mentioned in the connection URL.

Currently, the tenant name is only displayed in the SQL shell prompt if the connection string contained it to start with. This is a problem when an "application tenant" is defined, because then it is used implicitely and its name is not mentioned in the connection string. So it does not appear in the SQL prompt.

Describe the solution you'd like

  • a SQL session variable that shows the name of the virtual cluster the session is connected to.
  • replace the logic in the SQL shell that displays the VC name to use the session var instead of the conn string.

Epic: CRDB-26691

Jira issue: CRDB-31929

@knz knz added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-multitenant Issues owned by the multi-tenant virtual team A-cli-client CLI commands that pertain to using SQL features labels Sep 29, 2023
@exalate-issue-sync exalate-issue-sync bot removed the A-cli-client CLI commands that pertain to using SQL features label Sep 29, 2023
@knz knz self-assigned this Oct 2, 2023
craig bot pushed a commit that referenced this issue Oct 2, 2023
111565: sql: show the virtual cluster name via a session var r=stevendanna a=knz

Informs #111491.
Epic: CRDB-26691

Release note (cluster virtualization): The name of the virtual cluster that the SQL client is connected to can now be inspected via the SQL session var `virtual_cluster_name`.

Co-authored-by: Raphael 'kena' Poss <[email protected]>
@craig craig bot closed this as completed in c133865 Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-multitenant Issues owned by the multi-tenant virtual team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant