Skip to content

Application Name support in connection string#7

Merged
potatoqualitee merged 4 commits intodataplat:masterfrom
alevyinroc:master
Sep 5, 2017
Merged

Application Name support in connection string#7
potatoqualitee merged 4 commits intodataplat:masterfrom
alevyinroc:master

Conversation

@alevyinroc
Copy link
Contributor

These changes add support for a new optional parameter, ApplicationName. If specified, this parameter's value will be added to the ConnectionString's Application Name parameter. If not supplied, an attempt to determine the parent script's filename is made.

I've also changed the creation of the ConnectionString from basic string formatting to using the SqlConnectionStringBuilder class to reduce redundant code and make adding parameters into the ConnectionString on a conditional basis cleaner.

Added SqlConnectionStringBuilder and rewrote logic to create comparable ConnectionStrings to previous version. Added support for Application Name either as a parameter or determined from the calling script's name
@RamblingCookieMonster
Copy link
Collaborator

Hi @alevyinroc!

Thanks for this, awesome idea (both adding the application name, and building the connection string without silly string manipulation).

I think it might make sense to submit this PR to the function in dbatools - still deciding what to do with this repo (e.g. push to it if invoke-sqlcmd2.ps1 changes in dbatools, leave it alone, etc.)

cc @ctrlbold

Cheers!

@alevyinroc
Copy link
Contributor Author

I didn't even realize that it was in dbatools! Is there an easy way to migrate the PR there, or should I fork that repo, redo my changes and then submit?

@RamblingCookieMonster
Copy link
Collaborator

I'm guessing a patch would be difficult given that these are different repos with the file in a different spot - might be worth just redoing the PR over there?

@alevyinroc
Copy link
Contributor Author

Forked & recommitted my changes, will have to review the contribution guidelines before I go for the PR.

@potatoqualitee
Copy link
Member

I like invoke-Sqlcmd2 being a sep. command because it does not require SMO. Though that's a moot point now. Hmmmm. But I just keep an eye on this and when changes are pushed, I copy it, nbd. @RamblingCookieMonster - mind if I accept PRs for this repo?

@RamblingCookieMonster
Copy link
Collaborator

Works for me, awesome!

@potatoqualitee potatoqualitee merged commit 9917d87 into dataplat:master Sep 5, 2017
@potatoqualitee
Copy link
Member

@alevyinroc - make sure you sync this one before adding back your other changes!

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.

3 participants