mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
fixed the issue with defualt values for options not loaded correctly (#581)
This commit is contained in:
@@ -691,7 +691,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
||||
/// <summary>
|
||||
/// Returns the value of ScriptIndexes Property
|
||||
/// </summary>
|
||||
public bool? DriIndexes { get { return ScriptOptions.ScriptIndexes; } }
|
||||
public bool? Indexes { get { return ScriptOptions.ScriptIndexes; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -75,7 +75,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
||||
UrnCollection urns = CreateUrns(ServerConnection);
|
||||
ScriptingOptions options = new ScriptingOptions();
|
||||
SetScriptBehavior(options);
|
||||
PopulateAdvancedScriptOptions(this.Parameters.ScriptOptions, options);
|
||||
ScriptAsOptions scriptAsOptions = new ScriptAsOptions(this.Parameters.ScriptOptions);
|
||||
PopulateAdvancedScriptOptions(scriptAsOptions, options);
|
||||
options.WithDependencies = false;
|
||||
// TODO: Not including the header by default. We have to get this option from client
|
||||
options.IncludeHeaders = false;
|
||||
|
||||
@@ -89,7 +89,14 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
[Fact]
|
||||
public async void VerifyScriptAsCreateTable()
|
||||
{
|
||||
string query = "CREATE TABLE testTable1 (c1 int)";
|
||||
string query = @"CREATE TABLE testTable1 (c1 int)
|
||||
GO
|
||||
CREATE CLUSTERED INDEX [ClusteredIndex-1] ON [dbo].[testTable1]
|
||||
(
|
||||
[c1] ASC
|
||||
)
|
||||
GO
|
||||
";
|
||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Create;
|
||||
ScriptingObject scriptingObject = new ScriptingObject
|
||||
{
|
||||
@@ -97,9 +104,10 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
Schema = "dbo",
|
||||
Type = "Table"
|
||||
};
|
||||
string expectedScript = "CREATE TABLE [dbo].[testTable1]";
|
||||
List<string> expectedScripts = new List<string> { "CREATE TABLE [dbo].[testTable1]", "CREATE CLUSTERED INDEX [ClusteredIndex-1] ON [dbo].[testTable1]" };
|
||||
|
||||
await VerifyScriptAs(query, scriptingObject, scriptCreateDrop, expectedScript);
|
||||
|
||||
await VerifyScriptAsForMultipleObjects(query, new List<ScriptingObject> { scriptingObject }, scriptCreateDrop, expectedScripts);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user