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:
Benjamin Russell
2017-03-21 15:14:04 -07:00
committed by GitHub
parent 9e576dea92
commit d7ecfb1a87
26 changed files with 1165 additions and 165 deletions

View File

@@ -0,0 +1,45 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.EditData.Contracts
{
/// <summary>
/// A way to return a row in a result set that is being edited. It contains state about whether
/// or not the row is dirty
/// </summary>
public class EditRow
{
public enum EditRowState
{
Clean = 0,
DirtyInsert = 1,
DirtyDelete = 2,
DirtyUpdate = 3
}
/// <summary>
/// The cells in the row. If the row has pending changes, they will be represented in
/// this list
/// </summary>
public DbCellValue[] Cells { get; set; }
/// <summary>
/// Internal ID of the row. This should be used whenever referencing a row in row edit operations.
/// </summary>
public long Id { get; set; }
/// <summary>
/// Whether or not the row has changes pending
/// </summary>
public bool IsDirty => State != EditRowState.Clean;
/// <summary>
/// What type of dirty state (or lack thereof) the row is
/// </summary>
public EditRowState State { get; set; }
}
}