Insert sql bindings into Azure Functions (#1224)

* getting table name from a script

* add InsertSqlInputBindingOperation

* cleanup

* move azure functions stuff out of dacfx service

* cleanup

* add tests

* add another test

* cleanup

* add comments and connection string setting

* addressing comments

* change name to use add instead of insert
This commit is contained in:
Kim Santiago
2021-08-04 13:02:52 -07:00
committed by GitHub
parent a7703e63a4
commit b1653b25e4
15 changed files with 682 additions and 1 deletions

View File

@@ -0,0 +1,60 @@
//
// 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;
using Microsoft.SqlTools.ServiceLayer.SchemaCompare.Contracts;
using Microsoft.SqlTools.ServiceLayer.Utility;
namespace Microsoft.SqlTools.ServiceLayer.AzureFunctions.Contracts
{
/// <summary>
/// Binding types for sql bindings for Azure Functions
/// </summary>
public enum BindingType
{
input,
output
}
/// <summary>
/// Parameters for adding a sql binding
/// </summary>
public class AddSqlBindingParams
{
/// <summary>
/// Gets or sets the filePath
/// </summary>
public string filePath { get; set; }
/// <summary>
/// Gets or sets the binding type
/// </summary>
public BindingType bindingType { get; set; }
/// <summary>
/// Gets or sets the function name
/// </summary>
public string functionName { get; set; }
/// <summary>
/// Gets or sets the object name
/// </summary>
public string objectName { get; set; }
/// <summary>
/// Gets or sets the connection string setting
/// </summary>
public string connectionStringSetting { get; set; }
}
/// <summary>
/// Defines the Add Sql Binding request
/// </summary>
class AddSqlBindingRequest
{
public static readonly RequestType<AddSqlBindingParams, ResultStatus> Type =
RequestType<AddSqlBindingParams, ResultStatus>.Create("azureFunctions/sqlBinding");
}
}