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

Application Name support in connection string #7

Merged
merged 4 commits into from Sep 5, 2017

Conversation

Projects
None yet
3 participants
@alevyinroc
Contributor

alevyinroc commented Jan 20, 2017

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.

alevyinroc added some commits Dec 21, 2016

Switch to use SqlConnectionStringBuilder, add application name
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

This comment has been minimized.

Show comment
Hide comment
@RamblingCookieMonster

RamblingCookieMonster Jan 20, 2017

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!

Collaborator

RamblingCookieMonster commented Jan 20, 2017

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

This comment has been minimized.

Show comment
Hide comment
@alevyinroc

alevyinroc Jan 20, 2017

Contributor

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?

Contributor

alevyinroc commented Jan 20, 2017

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

This comment has been minimized.

Show comment
Hide comment
@RamblingCookieMonster

RamblingCookieMonster Jan 20, 2017

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?

Collaborator

RamblingCookieMonster commented Jan 20, 2017

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

This comment has been minimized.

Show comment
Hide comment
@alevyinroc

alevyinroc Jan 20, 2017

Contributor

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

Contributor

alevyinroc commented Jan 20, 2017

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

@potatoqualitee

This comment has been minimized.

Show comment
Hide comment
@potatoqualitee

potatoqualitee Sep 5, 2017

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?

Member

potatoqualitee commented Sep 5, 2017

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

This comment has been minimized.

Show comment
Hide comment
@RamblingCookieMonster

RamblingCookieMonster Sep 5, 2017

Collaborator

Works for me, awesome!

Collaborator

RamblingCookieMonster commented Sep 5, 2017

Works for me, awesome!

@potatoqualitee potatoqualitee merged commit 9917d87 into sqlcollaborative:master Sep 5, 2017

@potatoqualitee

This comment has been minimized.

Show comment
Hide comment
@potatoqualitee

potatoqualitee Sep 5, 2017

Member

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

Member

potatoqualitee commented Sep 5, 2017

@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