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

Add SPID to toolbar #24679

Merged
merged 47 commits into from
Nov 15, 2023
Merged

Add SPID to toolbar #24679

merged 47 commits into from
Nov 15, 2023

Conversation

smartguest
Copy link
Contributor

@smartguest smartguest commented Oct 13, 2023

Adds the SPID of the current connection/editor to the bottom right bar, similar to SSMS, added as part of the connection status (in it's own section though):

Images:
Default connection SPID:
Default Connection Screen

Query Editor (showing editor SPID):
Query Editor Screen

Non Query-Related connections/databases selected on Object Explorer:

Object Explorer Separate Connection

Object Explorer Separate Database

Fixes: #229

Companion PRs:

microsoft/sqltoolsservice#2269

microsoft/sqlops-dataprotocolclient#97

@alanrenmsft
Copy link
Contributor

please make sure this is only displayed when the spid is available, other providers won't have this information at the beginning. also it would be nice to adjust comments to make it more generic and allow extensions to provider their own preferred display name instead of hardcoding it to spid.

@alanrenmsft
Copy link
Contributor

for example: in Postgres it is called PID.

Copy link
Contributor

@Charles-Gagnon Charles-Gagnon left a comment

Choose a reason for hiding this comment

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

Are we not going to allow providers to specify the text/name to display then?

src/sql/azdata.proposed.d.ts Outdated Show resolved Hide resolved
src/sql/azdata.proposed.d.ts Outdated Show resolved Hide resolved
@Charles-Gagnon
Copy link
Contributor

@cheenamalhotra Can you take a look and make sure all the latest changes look good to you?

Change connection status description

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
@smartguest smartguest merged commit bac1aad into main Nov 15, 2023
12 checks passed
@smartguest smartguest deleted the alex/spidtoolbarbranch branch November 15, 2023 19:56
@EsSabtaouy
Copy link

@smartguest, @cheenamalhotra How can I integrate this solution into my ADS Program?

@cheenamalhotra
Copy link
Member

If you're working with MSSQL provider, and you're listening to onConnectionComplete or onQueryComplete events you can read property serverConnectionId (available in azdata.proposed.d.ts) to get SPID for the connection in use.

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.

Show SPID
7 participants