new dacfx version (#1587)

* pre-load database model

* revert pre-loading
This commit is contained in:
Alan Ren
2022-07-18 16:34:25 -07:00
committed by GitHub
parent 82118f6431
commit 591d308205
2 changed files with 7 additions and 4 deletions

View File

@@ -22,6 +22,8 @@ namespace Microsoft.SqlTools.ServiceLayer.TableDesigner
/// </summary>
public sealed class TableDesignerService : IDisposable
{
public const string TableDesignerApplicationName = "azdata-table-designer";
private Dictionary<string, Dac.TableDesigner> idTableMap = new Dictionary<string, Dac.TableDesigner>();
private bool disposed = false;
private static readonly Lazy<TableDesignerService> instance = new Lazy<TableDesignerService>(() => new TableDesignerService());
@@ -1468,9 +1470,10 @@ namespace Microsoft.SqlTools.ServiceLayer.TableDesigner
Dac.TableDesigner tableDesigner;
if (tableInfo.TableScriptPath == null)
{
var connectionStringbuilder = new SqlConnectionStringBuilder(tableInfo.ConnectionString);
connectionStringbuilder.InitialCatalog = tableInfo.Database;
var connectionString = connectionStringbuilder.ToString();
var connectionStringBuilder = new SqlConnectionStringBuilder(tableInfo.ConnectionString);
connectionStringBuilder.InitialCatalog = tableInfo.Database;
connectionStringBuilder.ApplicationName = TableDesignerService.TableDesignerApplicationName;
var connectionString = connectionStringBuilder.ToString();
tableDesigner = new Dac.TableDesigner(connectionString, tableInfo.AccessToken, tableInfo.Schema, tableInfo.Name, tableInfo.IsNewTable);
}
else