Skip to content

Commit

Permalink
More build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Nov 13, 2021
1 parent 836b1ad commit b815ac9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MarkMpn.Sql4Cds.SSMS/DmlExecute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ private void OnExecuteQuery(string Guid, int ID, object CustomIn, object CustomO
var options = new QueryExecutionOptions(sqlScriptEditorControl, Package.Settings);
var metadata = GetMetadataCache();
var org = ConnectCDS();
var dataSource = new DataSource { Name = "local", Metadata = metadata, TableSizeCache = new TableSizeCache(org, metadata) };

// We've possibly got a DML statement, so parse the query properly to get the details
var converter = new ExecutionPlanBuilder(metadata, new TableSizeCache(org, metadata), options)
var converter = new ExecutionPlanBuilder(new[] { dataSource }, dataSource.Name, options)
{
TDSEndpointAvailable = true,
QuotedIdentifiers = sqlScriptEditorControl.QuotedIdentifiers
Expand Down Expand Up @@ -139,7 +140,7 @@ private void OnExecuteQuery(string Guid, int ID, object CustomIn, object CustomO
try
{
_ai.TrackEvent("Execute", new Dictionary<string, string> { ["QueryType"] = query.GetType().Name, ["Source"] = "SSMS" });
var msg = query.Execute(org, metadata, options, null, null);
var msg = query.Execute(new Dictionary<string, DataSource>(StringComparer.OrdinalIgnoreCase) { [dataSource.Name] = dataSource }, options, null, null);

sqlScriptEditorControl.Results.AddStringToMessages(msg + "\r\n\r\n");

Expand Down

0 comments on commit b815ac9

Please sign in to comment.