mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 09:59:48 -05:00
A regression was introduced in the scripting service refactoring where data is no longer scripted. This commit fixes the issue, and updates the tests to catch this in the future. The issue is in the getter for SqlScriptPublishModel.AdvancedOptions, there is some strange logic which will cause the SqlScriptPublishModel.AdvancedOptions to get reset and lose all values based the ordering of when SqlScriptPublishModel.ScriptAllObjects is set. In the scripting service refactoring, we started to hit this reset of the AdvanceOptions, which would lose the option to script data, along with other options. To workaround this, we initialize with SqlScriptPublishModel.ScriptAllObjects to true, and then set all SqlScriptPublishModel.AdvancedOptions values. Then, we set SqlScriptPublishModel.ScriptAllObjects, and avoid calling the SqlScriptPublishModel.AdvancedOptions getter. Also including some misc scripting service changes: 1) Adding a sequence number field to the scripting operation events 2) Adding a error message to scripting progress events 3) Expect a null scripting option parameter 4) Correctly set the exception message and details for json-rpc events 5) More logging
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
//
|
|
|
|
using System.Collections.Generic;
|
|
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
|
|
|
namespace Microsoft.SqlTools.ServiceLayer.Scripting.Contracts
|
|
{
|
|
/// <summary>
|
|
/// Parameters sent when a list objects operation has completed.
|
|
/// </summary>
|
|
public class ScriptingListObjectsCompleteParams : ScriptingCompleteParams
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the list of database objects returned from the list objects operation.
|
|
/// </summary>
|
|
public List<ScriptingObject> ScriptingObjects { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the count of database object returned from the list objects operation.
|
|
/// </summary>
|
|
public int Count { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event sent to indicate a list objects operation has completed.
|
|
/// </summary>
|
|
public class ScriptingListObjectsCompleteEvent
|
|
{
|
|
public static readonly EventType<ScriptingListObjectsCompleteParams> Type =
|
|
EventType<ScriptingListObjectsCompleteParams>.Create("scripting/listObjectsComplete");
|
|
}
|
|
}
|