Skip to content

Conversation

Charles-Gagnon
Copy link
Contributor

@Charles-Gagnon Charles-Gagnon commented Apr 25, 2023

Noticed this while investigating something else - but we currently have a large amount of "duplicated" types in here. These are types which are already defined in azdata (usually due to them being exposed as provider callbacks).

There isn't any reason I can think of to have these extra ones here - they just add extra overhead to remember to update (and often times that step is missed). And the way that this library uses them is just as types, the original objects passed in are always going to be their azdata counterparts.

So I went through and removed a bunch that I saw. It's likely I missed a couple, but this makes it a lot cleaner and then we can just be better in the future about keeping an eye on what types are used/updated here and remove others we see as being unnecessary down the line.

I'm not planning on doing a new release for these since this stuff should all have no change on the existing behavior.


let registerOnConnectionChanged = (handler: (changedConnInfo: azdata.ChangedConnectionInfo) => any): void => {
client.onNotification(protocol.ConnectionChangedNotification.type, (params: protocol.ConnectionChangedParams) => {
handler({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only actual "change" in this PR - if for some reason the object we got passed had additional properties on it then we would now be passing those along to the provider. But this isn't how the rest of the handlers are set up anyways - and since this is coming from the server side we have control over that for MSSQL (and other providers shouldn't be sending additional data anyways).

@Charles-Gagnon Charles-Gagnon merged commit e68b544 into main Apr 25, 2023
@Charles-Gagnon Charles-Gagnon deleted the chgagnon/cleanupTypes branch April 25, 2023 21:00
alanrenmsft pushed a commit that referenced this pull request Jun 9, 2023
* Remove duplicated types

* Remove max line length
@alanrenmsft alanrenmsft mentioned this pull request Jun 9, 2023
alanrenmsft added a commit that referenced this pull request Jun 9, 2023
* Remove duplicated types (#85)

* Remove duplicated types

* Remove max line length

* add copy result to query provider (#86)

* add copy result to query provider

* fix error

* update js

---------

Co-authored-by: Charles Gagnon <[email protected]>
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.

2 participants