edit/revertCell (#268)

// edit/dispose -------------------------------------------------------------------------------
export interface EditDisposeParams extends IEditSessionOperationParams { }
export interface EditDisposeResult { }

* Initial plumbing for edit/revertCell

* Implementation of revert cell in the parents of the row edit base

* Adding unit tests
This commit is contained in:
Benjamin Russell
2017-03-08 14:49:13 -08:00
committed by GitHub
parent 666ee98582
commit c0468e763f
17 changed files with 469 additions and 39 deletions

View File

@@ -117,7 +117,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
/// <returns>Collection of test columns in the current result set</returns>
public ReadOnlyCollection<DbColumn> GetColumnSchema()
{
if (ResultSetEnumerator?.Current == null || ResultSetEnumerator.Current.Rows.Count <= 0)
if (ResultSetEnumerator?.Current == null)
{
return new ReadOnlyCollection<DbColumn>(new List<DbColumn>());
}
@@ -125,6 +125,22 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
return new ReadOnlyCollection<DbColumn>(ResultSetEnumerator.Current.Columns);
}
public override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length)
{
if (ResultSetEnumerator.Current.Columns[ordinal].DataType == typeof(byte[]))
{
byte[] data = (byte[]) this[ordinal];
if (buffer == null)
{
return data.Length;
}
Array.Copy(data, (int)dataOffset, buffer, bufferOffset, length);
return Math.Min(length, data.Length);
}
throw new InvalidOperationException();
}
#endregion
#region Not Implemented
@@ -139,11 +155,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
throw new NotImplementedException();
}
public override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length)
{
throw new NotImplementedException();
}
public override char GetChar(int ordinal)
{
throw new NotImplementedException();