Skip to content

Initial code for switching database on the current server #12

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

Merged
merged 2 commits into from
Aug 2, 2016

Conversation

MitchellSternke
Copy link
Member

This is an initial hacky solution that queries sys.databases to find a list of databases on the current server. Just thought I'd get this out for review so we can get it in sooner rather than later.

const self = this;
return new Promise<Interfaces.IConnectionCredentials>((resolve, reject) => {
// create a new connection to the master db using the current connection as a base
const masterCredentials = <Interfaces.IConnectionCredentials> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're binding to ES6 - can we use Object.assign per microsoft/TypeScript#3429? This would avoid the very manual, hacky copying of properties. It would be much easier to clone & change database value afterwards.

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is hard please skip - we can probably add support in the .Net layer instead.

@kevcunnane
Copy link
Contributor

Looks like you need to handle merge conflicts before submitting - otherwise looks good (with some comments). Given we'll fix up once we move to service layer, I'm not too concerned.

  • Status: Signed off

@MitchellSternke MitchellSternke merged commit 2a7425e into dev Aug 2, 2016
@kevcunnane kevcunnane deleted the dev_chooseDatabase branch September 8, 2016 18:25
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.

4 participants