Initial metadata and scripting services (#280)

* Initial metadata service and scripting service files

* Simple metadata lookup with SMO objects

* Add metadata type class

* Remove SMO from metadata service.

* Cleanup metadata service SQL

* Initial MetadataService test

* Add scripting commands

* Add metadata test case

* Remove sleep used for testing

* Use random table name in metadata test

* Add scripting tests
This commit is contained in:
Karl Burtram
2017-03-14 22:35:17 -07:00
committed by GitHub
parent 9b1e07907e
commit 7ba2011a1e
9 changed files with 588 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.Metadata.Contracts
{
public class MetadataQueryParams
{
public string OwnerUri { get; set; }
}
public class MetadataQueryResult
{
public ObjectMetadata[] Metadata { get; set; }
}
public class MetadataListRequest
{
public static readonly
RequestType<MetadataQueryParams, MetadataQueryResult> Type =
RequestType<MetadataQueryParams, MetadataQueryResult>.Create("metadata/list");
}
}

View File

@@ -0,0 +1,32 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.SqlTools.ServiceLayer.Metadata.Contracts
{
/// <summary>
/// Metadata type enumeration
/// </summary>
public enum MetadataType
{
Table = 0,
View = 1,
SProc = 2,
Function = 3
}
/// <summary>
/// Object metadata information
/// </summary>
public class ObjectMetadata
{
public MetadataType MetadataType { get; set; }
public string MetadataTypeName { get; set; }
public string Schema { get; set; }
public string Name { get; set; }
}
}