mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-18 17:23:52 -05:00
feature/edit/subset (#283)
* Changing query/subset API to only use Result on success, Error on error * Creating an interservice API for getting query result subsets * Updates to subset API * RowStartIndex is now long * Output of query/subset is a 2D array of DbCellValue * Adding LongSkip method to LongList to allow skipping ahead by longs * Moving LongList back to ServiceLayer utilities. Move refactoring * Stubbing out request for edit/subset * Initial implementation of getting edit rows * Unit tests for RowEdit and RowDelete .GetEditRow * Fixing major bugs in LongList implementation, adding much more thorough tests * Adding some more unit tests and fixes to make unit tests pass * Fixing comment
This commit is contained in:
@@ -91,6 +91,7 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
|
||||
serviceHost.SetRequestHandler(EditInitializeRequest.Type, HandleInitializeRequest);
|
||||
serviceHost.SetRequestHandler(EditRevertCellRequest.Type, HandleRevertCellRequest);
|
||||
serviceHost.SetRequestHandler(EditRevertRowRequest.Type, HandleRevertRowRequest);
|
||||
serviceHost.SetRequestHandler(EditSubsetRequest.Type, HandleSubsetRequest);
|
||||
serviceHost.SetRequestHandler(EditUpdateCellRequest.Type, HandleUpdateCellRequest);
|
||||
}
|
||||
|
||||
@@ -241,6 +242,20 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
|
||||
});
|
||||
}
|
||||
|
||||
internal Task HandleSubsetRequest(EditSubsetParams subsetParams,
|
||||
RequestContext<EditSubsetResult> requestContext)
|
||||
{
|
||||
return HandleSessionRequest(subsetParams, requestContext, session =>
|
||||
{
|
||||
EditRow[] rows = session.GetRows(subsetParams.RowStartIndex, subsetParams.RowCount).Result;
|
||||
return new EditSubsetResult
|
||||
{
|
||||
RowCount = rows.Length,
|
||||
Subset = rows
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
internal Task HandleUpdateCellRequest(EditUpdateCellParams updateParams,
|
||||
RequestContext<EditUpdateCellResult> requestContext)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user