//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlServer.Dac.Compare;
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.ServiceLayer.Utility;
using System.Collections.Generic;
namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare.Contracts
{
public enum SchemaCompareEndpointType
{
Database,
Dacpac
}
public class SchemaCompareEndpointInfo
{
///
/// Gets or sets the type of the endpoint
///
public SchemaCompareEndpointType EndpointType { get; set; }
///
/// Gets or sets package filepath
///
public string PackageFilePath { get; set; }
///
/// Gets or sets name for the database
///
public string DatabaseName { get; set; }
///
/// Connection uri
///
public string OwnerUri { get; set; }
}
///
/// Parameters for a schema compare request.
///
public class SchemaCompareParams
{
///
/// Gets or sets the source endpoint info
///
public SchemaCompareEndpointInfo SourceEndpointInfo { get; set; }
///
/// Gets or sets the target endpoint info
///
public SchemaCompareEndpointInfo TargetEndpointInfo { get; set; }
///
/// Executation mode for the operation. Default is execution
///
public TaskExecutionMode TaskExecutionMode { get; set; }
///
/// gets or sets the deployment options for schema compare
///
public DeploymentOptions DeploymentOptions { get; set; }
}
///
/// Parameters returned from a schema compare request.
///
public class SchemaCompareResult : ResultStatus
{
public string OperationId { get; set; }
public bool AreEqual { get; set; }
public List Differences { get; set; }
}
public class DiffEntry
{
public SchemaUpdateAction UpdateAction { get; set; }
public SchemaDifferenceType DifferenceType { get; set; }
public string Name { get; set; }
public string SourceValue { get; set; }
public string TargetValue { get; set; }
public DiffEntry Parent { get; set; }
public List Children { get; set; }
public string SourceScript { get; set; }
public string TargetScript { get; set; }
}
///
/// Defines the Schema Compare request type
///
class SchemaCompareRequest
{
public static readonly RequestType Type =
RequestType.Create("schemaCompare/compare");
}
}