mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Add group id and db display name to OE connection queue key (#531)
This commit is contained in:
@@ -467,7 +467,35 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the group ID
|
||||
/// </summary>
|
||||
public string GroupId
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetOptionValue<string>("groupId");
|
||||
}
|
||||
set
|
||||
{
|
||||
SetOptionValue("groupId", value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the database display name
|
||||
/// </summary>
|
||||
public string DatabaseDisplayName
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetOptionValue<string>("databaseDisplayName");
|
||||
}
|
||||
set
|
||||
{
|
||||
SetOptionValue("databaseDisplayName", value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsComparableTo(ConnectionDetails other)
|
||||
{
|
||||
|
||||
@@ -72,12 +72,24 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
private string GetConnectionContextKey(ConnectionInfo connInfo)
|
||||
{
|
||||
ConnectionDetails details = connInfo.ConnectionDetails;
|
||||
return string.Format("{0}_{1}_{2}_{3}",
|
||||
string key = string.Format("{0}_{1}_{2}_{3}",
|
||||
details.ServerName ?? "NULL",
|
||||
details.DatabaseName ?? "NULL",
|
||||
details.UserName ?? "NULL",
|
||||
details.AuthenticationType ?? "NULL"
|
||||
);
|
||||
|
||||
if (!string.IsNullOrEmpty(details.DatabaseDisplayName))
|
||||
{
|
||||
key += "_" + details.DatabaseDisplayName;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(details.GroupId))
|
||||
{
|
||||
key += "_" + details.GroupId;
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -605,6 +605,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
string uri = string.Format(CultureInfo.InvariantCulture, "{0}{1}", uriPrefix, Uri.EscapeUriString(details.ServerName));
|
||||
uri = AppendIfExists(uri, "databaseName", details.DatabaseName);
|
||||
uri = AppendIfExists(uri, "user", details.UserName);
|
||||
uri = AppendIfExists(uri, "groupId", details.GroupId);
|
||||
uri = AppendIfExists(uri, "displayName", details.DatabaseDisplayName);
|
||||
return uri;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user