mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Added grouping between system/user dbs when listing (#70)
This commit is contained in:
@@ -202,24 +202,23 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
// try to get information about the connected SQL Server instance
|
// try to get information about the connected SQL Server instance
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var connection = connectionInfo.SqlConnection as ReliableSqlConnection;
|
var reliableConnection = connectionInfo.SqlConnection as ReliableSqlConnection;
|
||||||
if (connection != null)
|
DbConnection connection = reliableConnection != null ? reliableConnection.GetUnderlyingConnection() : connectionInfo.SqlConnection;
|
||||||
|
|
||||||
|
ReliableConnectionHelper.ServerInfo serverInfo = ReliableConnectionHelper.GetServerVersion(connection);
|
||||||
|
response.ServerInfo = new Contracts.ServerInfo()
|
||||||
{
|
{
|
||||||
ReliableConnectionHelper.ServerInfo serverInfo = ReliableConnectionHelper.GetServerVersion(connection.GetUnderlyingConnection());
|
ServerMajorVersion = serverInfo.ServerMajorVersion,
|
||||||
response.ServerInfo = new Contracts.ServerInfo()
|
ServerMinorVersion = serverInfo.ServerMinorVersion,
|
||||||
{
|
ServerReleaseVersion = serverInfo.ServerReleaseVersion,
|
||||||
ServerMajorVersion = serverInfo.ServerMajorVersion,
|
EngineEditionId = serverInfo.EngineEditionId,
|
||||||
ServerMinorVersion = serverInfo.ServerMinorVersion,
|
ServerVersion = serverInfo.ServerVersion,
|
||||||
ServerReleaseVersion = serverInfo.ServerReleaseVersion,
|
ServerLevel = serverInfo.ServerLevel,
|
||||||
EngineEditionId = serverInfo.EngineEditionId,
|
ServerEdition = serverInfo.ServerEdition,
|
||||||
ServerVersion = serverInfo.ServerVersion,
|
IsCloud = serverInfo.IsCloud,
|
||||||
ServerLevel = serverInfo.ServerLevel,
|
AzureVersion = serverInfo.AzureVersion,
|
||||||
ServerEdition = serverInfo.ServerEdition,
|
OsVersion = serverInfo.OsVersion
|
||||||
IsCloud = serverInfo.IsCloud,
|
};
|
||||||
AzureVersion = serverInfo.AzureVersion,
|
|
||||||
OsVersion = serverInfo.OsVersion
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
@@ -291,7 +290,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
connection.Open();
|
connection.Open();
|
||||||
|
|
||||||
DbCommand command = connection.CreateCommand();
|
DbCommand command = connection.CreateCommand();
|
||||||
command.CommandText = "SELECT name FROM sys.databases";
|
command.CommandText = "SELECT name FROM sys.databases ORDER BY database_id ASC";
|
||||||
command.CommandTimeout = 15;
|
command.CommandTimeout = 15;
|
||||||
command.CommandType = CommandType.Text;
|
command.CommandType = CommandType.Text;
|
||||||
var reader = command.ExecuteReader();
|
var reader = command.ExecuteReader();
|
||||||
|
|||||||
Reference in New Issue
Block a user