mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-27 09:35:38 -05:00
Fixed issue where no-op queries would never complete (#157)
* Fixed issue where no-op queries would never complete * Changed approach to solving the race condition with no-op queries * Addressing feedback
This commit is contained in:
@@ -272,6 +272,23 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run a query using a given connection bound to a URI. This method only waits for the initial response from query
|
||||
/// execution (QueryExecuteResult). It is up to the caller to wait for the QueryExecuteCompleteEvent if they are interested.
|
||||
/// </summary>
|
||||
public async Task<QueryExecuteResult> RunQueryAsync(string ownerUri, string query, int timeoutMilliseconds = 5000)
|
||||
{
|
||||
WriteToFile(ownerUri, query);
|
||||
|
||||
var queryParams = new QueryExecuteParams
|
||||
{
|
||||
OwnerUri = ownerUri,
|
||||
QuerySelection = null
|
||||
};
|
||||
|
||||
return await Driver.SendRequest(QueryExecuteRequest.Type, queryParams);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request to cancel an executing query
|
||||
|
||||
Reference in New Issue
Block a user