-
Notifications
You must be signed in to change notification settings - Fork 145
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
Schema Compare open SCMP file #825
Conversation
cbd8c1d
to
3c5db95
Compare
src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/SchemaCompareOpenScmpOperation.cs
Show resolved
Hide resolved
src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/SchemaCompareOpenScmpOperation.cs
Show resolved
Hide resolved
src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/SchemaCompareService.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.SqlTools.ServiceLayer.IntegrationTests/SchemaCompare/SchemaCompareServiceTests.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.SqlTools.ServiceLayer.IntegrationTests/SchemaCompare/SchemaCompareServiceTests.cs
Show resolved
Hide resolved
} | ||
else | ||
{ | ||
// need to parse xml to get connection string of database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pensivebrian should we make the connection string getter to be public in DacFx SchemaCompareDatabaseEndpoint - so that we don't have to do parsing here? What do you think? I am worried that parsing might need constant maintenance if things around this change in DacFx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have enough context to have an opinion. I'll leave it up to you two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with some minor issues.
src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/SchemaCompareOpenScmpOperation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/SchemaCompareOpenScmpOperation.cs
Outdated
Show resolved
Hide resolved
} | ||
else | ||
{ | ||
// need to parse xml to get connection string of database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have enough context to have an opinion. I'll leave it up to you two.
src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/SchemaCompareOperation.cs
Outdated
Show resolved
Hide resolved
try | ||
{ | ||
operation = new SchemaCompareOpenScmpOperation(parameters); | ||
operation.Execute(TaskExecutionMode.Execute); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why make async methods with the operation is sync? Shouldn't this be async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Brian I think I can answer this one... so from what I understood (from query editor calls) is that sync Handle*request methods keep the process channel between ADS and sqltoolsservice busy - so for any operation that can be take longer we create an async task/thread and start it but don't wat on it and resturn from Request*Handle method. The task then returns through RequestContext whenever it completes/errors out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. Blocking the json/rpc channel seems like a bad idea as no other request can be serviced, right? I guess the question is why makes this method async in the first place? But if this is existing pattern that's used elsewhere, then I guess it makes sense to be consistent.
This takes a request to open an SCMP file and returns the source and target endpoint info, deployment options, and excluded elements. Some xml parsing still had to be done to get the included/excluded elements and because the source and target info of SchemaComparison are internal.
Will add deployment options checks to tests after Udeesha's changes get checked in since it has a helper to compare options.