mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user