mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-16 17:23:38 -05:00
Merge create db work in progress (#341)
* Port over initial block of create db implementation * Test case placeholder * In-progress work * Stage changes to other machine * Add database prototype strings * Stage changes to other machine * Stage changes * Hook the database info into capabilities discovery * Stage changes * Update SMO to latest from ssms_main * Various clean-ups * Update localization files
This commit is contained in:
@@ -0,0 +1,300 @@
|
||||
//
|
||||
// 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.Contracts;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class for providing metadata about connection options
|
||||
/// </summary>
|
||||
internal class ConnectionProviderOptionsHelper
|
||||
{
|
||||
internal static ConnectionProviderOptions BuildConnectionProviderOptions()
|
||||
{
|
||||
return new ConnectionProviderOptions
|
||||
{
|
||||
Options = new ConnectionOption[]
|
||||
{
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "server",
|
||||
DisplayName = "Server Name",
|
||||
Description = "Name of the SQL Server instance",
|
||||
ValueType = ConnectionOption.ValueTypeString,
|
||||
SpecialValueType = ConnectionOption.SpecialValueServerName,
|
||||
IsIdentity = true,
|
||||
IsRequired = true,
|
||||
GroupName = "Source"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "database",
|
||||
DisplayName = "Database Name",
|
||||
Description = "The name of the initial catalog or database int the data source",
|
||||
ValueType = ConnectionOption.ValueTypeString,
|
||||
SpecialValueType = ConnectionOption.SpecialValueDatabaseName,
|
||||
IsIdentity = true,
|
||||
IsRequired = false,
|
||||
GroupName = "Source"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "authenticationType",
|
||||
DisplayName = "Authentication Type",
|
||||
Description = "Specifies the method of authenticating with SQL Server",
|
||||
ValueType = ConnectionOption.ValueTypeCategory,
|
||||
SpecialValueType = ConnectionOption.SpecialValueAuthType,
|
||||
CategoryValues = new CategoryValue[]
|
||||
{ new CategoryValue {DisplayName = "SQL Login", Name = "SqlLogin" },
|
||||
new CategoryValue {DisplayName = "Integrated Auth", Name= "Integrated" }
|
||||
},
|
||||
IsIdentity = true,
|
||||
IsRequired = true,
|
||||
GroupName = "Security"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "user",
|
||||
DisplayName = "User Name",
|
||||
Description = "Indicates the user ID to be used when connecting to the data source",
|
||||
ValueType = ConnectionOption.ValueTypeString,
|
||||
SpecialValueType = ConnectionOption.SpecialValueUserName,
|
||||
IsIdentity = true,
|
||||
IsRequired = true,
|
||||
GroupName = "Security"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "password",
|
||||
DisplayName = "Password",
|
||||
Description = "Indicates the password to be used when connecting to the data source",
|
||||
ValueType = ConnectionOption.ValueTypePassword,
|
||||
SpecialValueType = ConnectionOption.SpecialValuePasswordName,
|
||||
IsIdentity = true,
|
||||
IsRequired = true,
|
||||
GroupName = "Security"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "applicationIntent",
|
||||
DisplayName = "Application Intent",
|
||||
Description = "Declares the application workload type when connecting to a server",
|
||||
ValueType = ConnectionOption.ValueTypeCategory,
|
||||
CategoryValues = new CategoryValue[] {
|
||||
new CategoryValue { Name = "ReadWrite", DisplayName = "ReadWrite" },
|
||||
new CategoryValue {Name = "ReadOnly", DisplayName = "ReadOnly" }
|
||||
},
|
||||
GroupName = "Initialization"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "asynchronousProcessing",
|
||||
DisplayName = "Asynchronous processing enabled",
|
||||
Description = "When true, enables usage of the Asynchronous functionality in the .Net Framework Data Provider",
|
||||
ValueType = ConnectionOption.ValueTypeBoolean,
|
||||
GroupName = "Initialization"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "connectTimeout",
|
||||
DisplayName = "Connect Timeout",
|
||||
Description =
|
||||
"The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error",
|
||||
ValueType = ConnectionOption.ValueTypeNumber,
|
||||
DefaultValue = "15",
|
||||
GroupName = "Initialization"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "currentLanguage",
|
||||
DisplayName = "Current Language",
|
||||
Description = "The SQL Server language record name",
|
||||
ValueType = ConnectionOption.ValueTypeString,
|
||||
GroupName = "Initialization"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "columnEncryptionSetting",
|
||||
DisplayName = "Column Encryption Setting",
|
||||
Description = "Default column encryption setting for all the commands on the connection",
|
||||
ValueType = ConnectionOption.ValueTypeCategory,
|
||||
GroupName = "Security",
|
||||
CategoryValues = new CategoryValue[] {
|
||||
new CategoryValue { Name = "Disabled" },
|
||||
new CategoryValue {Name = "Enabled" }
|
||||
}
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "encrypt",
|
||||
DisplayName = "Encrypt",
|
||||
Description =
|
||||
"When true, SQL Server uses SSL encryption for all data sent between the client and server if the servers has a certificate installed",
|
||||
GroupName = "Security",
|
||||
ValueType = ConnectionOption.ValueTypeBoolean
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "persistSecurityInfo",
|
||||
DisplayName = "Persist Security Info",
|
||||
Description = "When false, security-sensitive information, such as the password, is not returned as part of the connection",
|
||||
GroupName = "Security",
|
||||
ValueType = ConnectionOption.ValueTypeBoolean
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "trustServerCertificate",
|
||||
DisplayName = "Trust Server Certificate",
|
||||
Description = "When true (and encrypt=true), SQL Server uses SSL encryption for all data sent between the client and server without validating the server certificate",
|
||||
GroupName = "Security",
|
||||
ValueType = ConnectionOption.ValueTypeBoolean
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "attachedDBFileName",
|
||||
DisplayName = "Attached DB File Name",
|
||||
Description = "The name of the primary file, including the full path name, of an attachable database",
|
||||
ValueType = ConnectionOption.ValueTypeString,
|
||||
GroupName = "Source"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "contextConnection",
|
||||
DisplayName = "Context Connection",
|
||||
Description = "When true, indicates the connection should be from the SQL server context. Available only when running in the SQL Server process",
|
||||
ValueType = ConnectionOption.ValueTypeBoolean,
|
||||
GroupName = "Source"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "port",
|
||||
DisplayName = "Port",
|
||||
ValueType = ConnectionOption.ValueTypeNumber
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "connectRetryCount",
|
||||
DisplayName = "Connect Retry Count",
|
||||
Description = "Number of attempts to restore connection",
|
||||
ValueType = ConnectionOption.ValueTypeNumber,
|
||||
DefaultValue = "1",
|
||||
GroupName = "Connection Resiliency"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "connectRetryInterval",
|
||||
DisplayName = "Connect Retry Interval",
|
||||
Description = "Delay between attempts to restore connection",
|
||||
ValueType = ConnectionOption.ValueTypeNumber,
|
||||
DefaultValue = "10",
|
||||
GroupName = "Connection Resiliency"
|
||||
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "applicationName",
|
||||
DisplayName = "Application Name",
|
||||
Description = "The name of the application",
|
||||
ValueType = ConnectionOption.ValueTypeString,
|
||||
GroupName = "Context"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "workstationId",
|
||||
DisplayName = "Workstation Id",
|
||||
Description = "The name of the workstation connecting to SQL Server",
|
||||
ValueType = ConnectionOption.ValueTypeString,
|
||||
GroupName = "Context"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "pooling",
|
||||
DisplayName = "Pooling",
|
||||
Description = "When true, the connection object is drawn from the appropriate pool, or if necessary, is created and added to the appropriate pool",
|
||||
ValueType = ConnectionOption.ValueTypeBoolean,
|
||||
GroupName = "Pooling"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "maxPoolSize",
|
||||
DisplayName = "Max Pool Size",
|
||||
Description = "The maximum number of connections allowed in the pool",
|
||||
ValueType = ConnectionOption.ValueTypeNumber,
|
||||
GroupName = "Pooling"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "minPoolSize",
|
||||
DisplayName = "Min Pool Size",
|
||||
Description = "The minimum number of connections allowed in the pool",
|
||||
ValueType = ConnectionOption.ValueTypeNumber,
|
||||
GroupName = "Pooling"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "loadBalanceTimeout",
|
||||
DisplayName = "Load Balance Timeout",
|
||||
Description = "The minimum amount of time (in seconds) for this connection to live in the pool before being destroyed",
|
||||
ValueType = ConnectionOption.ValueTypeNumber,
|
||||
GroupName = "Pooling"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "replication",
|
||||
DisplayName = "Replication",
|
||||
Description = "Used by SQL Server in Replication",
|
||||
ValueType = ConnectionOption.ValueTypeBoolean,
|
||||
GroupName = "Replication"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "attachDbFilename",
|
||||
DisplayName = "Attach Db Filename",
|
||||
ValueType = ConnectionOption.ValueTypeString
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "failoverPartner",
|
||||
DisplayName = "Failover Partner",
|
||||
Description = "the name or network address of the instance of SQL Server that acts as a failover partner",
|
||||
ValueType = ConnectionOption.ValueTypeString,
|
||||
GroupName = " Source"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "multiSubnetFailover",
|
||||
DisplayName = "Multi Subnet Failover",
|
||||
ValueType = ConnectionOption.ValueTypeBoolean
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "multipleActiveResultSets",
|
||||
DisplayName = "Multiple Active ResultSets",
|
||||
Description = "When true, multiple result sets can be returned and read from one connection",
|
||||
ValueType = ConnectionOption.ValueTypeBoolean,
|
||||
GroupName = "Advanced"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "packetSize",
|
||||
DisplayName = "Packet Size",
|
||||
Description = "Size in bytes of the network packets used to communicate with an instance of SQL Server",
|
||||
ValueType = ConnectionOption.ValueTypeNumber,
|
||||
GroupName = "Advanced"
|
||||
},
|
||||
new ConnectionOption
|
||||
{
|
||||
Name = "typeSystemVersion",
|
||||
DisplayName = "Type System Version",
|
||||
Description = "Indicates which server type system then provider will expose through the DataReader",
|
||||
ValueType = ConnectionOption.ValueTypeString,
|
||||
GroupName = "Advanced"
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user