mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-28 01:25:44 -05:00
Remove SELECT * from edit/initialize Query (#288)
* Major refactor of EditDataMetadata providers * EditMetadataFactory generates "basic" EditTableMetadata objects based entirely on SMO metadata * SmoEditTableMetadata no longer depends on SMO, making it unecessary to mock it * Renamed SmoEditTableMetadata to EditTableMetadata * EditTableMetadata can be extended with DbColumnWrappers * Moving logic for extending a EditColumnMetadata into that class * I *think* this will work for async execution of initialize tasks * Fixing unit tests for new Edit(Table|Column)Metadata classes * Async stuff that works! And passes unit tests * Adding unit tests Adding .idea to gitignore * Adding message to the EditSessionReadyEvent * Fixes from dev merge * Fixing unit tests that Rider didn't catch as failing May have been a bit heavy-handed with the async/await stuff * Couple changes as per PR comments
This commit is contained in:
@@ -4,11 +4,85 @@
|
||||
|
||||
using System;
|
||||
using System.Data.Common;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
|
||||
{
|
||||
public class TestDbColumn : DbColumn
|
||||
{
|
||||
#region Overridden Properties
|
||||
|
||||
public new bool AllowDBNull
|
||||
{
|
||||
get { return base.AllowDBNull.HasTrue(); }
|
||||
set { base.AllowDBNull = value; }
|
||||
}
|
||||
|
||||
public new string ColumnName
|
||||
{
|
||||
get { return base.ColumnName; }
|
||||
set { base.ColumnName = value; }
|
||||
}
|
||||
|
||||
public new int ColumnSize
|
||||
{
|
||||
get { return base.ColumnSize ?? -1; }
|
||||
set { base.ColumnSize = value; }
|
||||
}
|
||||
|
||||
public new Type DataType
|
||||
{
|
||||
get { return base.DataType; }
|
||||
set { base.DataType = value; }
|
||||
}
|
||||
|
||||
public new string DataTypeName
|
||||
{
|
||||
get { return base.DataTypeName; }
|
||||
set { base.DataTypeName = value; }
|
||||
}
|
||||
|
||||
public new bool IsAutoIncrement
|
||||
{
|
||||
get { return base.IsAutoIncrement.HasTrue(); }
|
||||
set { base.IsAutoIncrement = value; }
|
||||
}
|
||||
|
||||
public new bool IsLong
|
||||
{
|
||||
get { return base.IsLong.HasTrue(); }
|
||||
set { base.IsLong = value; }
|
||||
}
|
||||
|
||||
public new bool IsIdentity
|
||||
{
|
||||
get { return base.IsIdentity.HasTrue(); }
|
||||
set { base.IsIdentity = value; }
|
||||
}
|
||||
|
||||
public new bool IsKey
|
||||
{
|
||||
get { return base.IsKey.HasTrue(); }
|
||||
set { base.IsKey = value; }
|
||||
}
|
||||
|
||||
public new int NumericScale
|
||||
{
|
||||
get { return base.NumericScale ?? -1; }
|
||||
set { base.NumericScale = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public TestDbColumn()
|
||||
{
|
||||
base.ColumnName = "col";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a basic DbColumn that is an NVARCHAR(128) NULL
|
||||
/// </summary>
|
||||
/// <param name="columnName">Name of the column</param>
|
||||
public TestDbColumn(string columnName)
|
||||
{
|
||||
base.IsLong = false;
|
||||
@@ -18,34 +92,5 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
|
||||
base.DataType = typeof(string);
|
||||
base.DataTypeName = "nvarchar";
|
||||
}
|
||||
|
||||
public TestDbColumn(string columnName, string columnType)
|
||||
: this(columnName)
|
||||
{
|
||||
base.DataTypeName = columnType;
|
||||
}
|
||||
|
||||
public TestDbColumn(string columnName, string columnType, Type columnDataType)
|
||||
{
|
||||
base.IsLong = false;
|
||||
base.ColumnName = columnName;
|
||||
base.ColumnSize = 128;
|
||||
base.AllowDBNull = true;
|
||||
base.DataType = columnDataType;
|
||||
base.DataTypeName = columnType;
|
||||
}
|
||||
|
||||
public TestDbColumn(string columnName, string columnType, int scale)
|
||||
: this(columnName, columnType)
|
||||
{
|
||||
base.NumericScale = scale;
|
||||
}
|
||||
|
||||
public TestDbColumn(string columnName, bool isAutoIncrement)
|
||||
: this(columnName)
|
||||
{
|
||||
base.IsAutoIncrement = isAutoIncrement;
|
||||
base.IsIdentity = isAutoIncrement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user