mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-03 09:35:39 -05:00
Feature/reliable connection (#44)
* Initial commit of reliable connection port * Made ReliableSqlConnection inherit from DbConnection instead of IDbConnection * Cleanup * Fixed autocomplete service to use reliable connection * Fix copyright headers * Renamed ConnectResponse.Server to ServerInfo * Removed unused using * Addressing code review feedback
This commit is contained in:
@@ -5,13 +5,13 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.EditorServices.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection;
|
||||
using Microsoft.SqlTools.ServiceLayer.Hosting;
|
||||
using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts;
|
||||
@@ -418,14 +418,14 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
scriptInfo.BuildingMetadataEvent.WaitOne(LanguageService.OnConnectionWaitTimeout);
|
||||
scriptInfo.BuildingMetadataEvent.Reset();
|
||||
|
||||
var sqlConn = info.SqlConnection as SqlConnection;
|
||||
var sqlConn = info.SqlConnection as ReliableSqlConnection;
|
||||
if (sqlConn != null)
|
||||
{
|
||||
ServerConnection serverConn = new ServerConnection(sqlConn);
|
||||
ServerConnection serverConn = new ServerConnection(sqlConn.GetUnderlyingConnection());
|
||||
scriptInfo.MetadataDisplayInfoProvider = new MetadataDisplayInfoProvider();
|
||||
scriptInfo.MetadataProvider = SmoMetadataProvider.CreateConnectedProvider(serverConn);
|
||||
scriptInfo.Binder = BinderProvider.CreateBinder(scriptInfo.MetadataProvider);
|
||||
scriptInfo.ServerConnection = new ServerConnection(sqlConn);
|
||||
scriptInfo.ServerConnection = new ServerConnection(sqlConn.GetUnderlyingConnection());
|
||||
this.ScriptParseInfoMap[info.OwnerUri] = scriptInfo;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user