Enabling Files Tab to the database properties (#2169)

* sending dsc values to ADS

* modifying dsc method with unsupportable property IsValuedefault

* getting the options and added a bool flag to maintian checkbox for secondary to save

* sending data to ads

* Ready for PR with minimal changes of loading UI as expected, TODO:saving logic

* Excluding maxdop and resumable options from primary value conversion for 1/0's

* Adding Id to the info, as we cannot depend on names, as names can be altered in future

* saving successfully, todo-diff servers, script (secondary - primary compare and dont update),test, send null for unsupported

* adding nullable dsc for unsupported servers

* fixing script generation for some properties that are not touched. the generated script is unharmed but unnecessary here

* adding test conditions for database scoped configurations

* adding switch case method to get the values

* Removing Loc string for the TSQL options

* removing unnecessary using statement

* sending required data, verify autogrowth...

* using fullTextIndexing to open the files tab for sql server and not to other servers

* Adding test case and fixing createDatabase issue

* sending files as objecinfo

* Update src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype130.cs

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* comment update

* preparing filegroup and filetype options

* sending required all fields

* saving file code changes, need more to work

* Saving file is completed, todo:edit  & remove

* Logic to remove the file

* add,edit,save working

* cleaning merge conflicts accidentally added code

* Adding tests to validates Files by adding, removing, updating files

* adding comments

* all working including tests, except fileStream size question

* code review comments updates

* memoryoptimized filegroups should be part of filestream group

* failing tests fix

* Modify tests by create database using SqlTestDb

* Update src/Microsoft.SqlTools.ServiceLayer/ObjectManagement/ObjectTypes/Database/DatabaseHandler.cs

Co-authored-by: Cory Rivera <corivera@microsoft.com>

* fixing test

* commenting remove file testing as failing pipeline but passing locally

* using enum for type

* trying to fix the test in server, removed the complaining file from test

* removing fulltext param and test fix

* fixing the path..

* test fix

* missing conflict resolving

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
Co-authored-by: Cory Rivera <corivera@microsoft.com>
This commit is contained in:
Sai Avishkar Sreerama
2023-08-29 11:24:31 -05:00
committed by GitHub
parent 41ae066b46
commit 07c8069cfa
7 changed files with 314 additions and 51 deletions

View File

@@ -6,13 +6,16 @@
#nullable disable
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.Hosting.Protocol;
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.Utility;
using Microsoft.SqlTools.ServiceLayer.ObjectManagement;
using Microsoft.SqlTools.ServiceLayer.ObjectManagement.Contracts;
using Moq;
using Newtonsoft.Json.Linq;
using DatabaseFile = Microsoft.SqlTools.ServiceLayer.ObjectManagement.DatabaseFile;
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectManagement
{
@@ -104,6 +107,26 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectManagement
};
}
internal static DatabaseFile[] GetTestDatabaseFiles()
{
List<DatabaseFile> databaseFiles = new List<DatabaseFile>() {
new DatabaseFile() {
Id = 0,
Name = "TestDatabaseName_File1_" + new Random().NextInt64(10000000, 90000000).ToString(),
Type = "LOG",
AutoFileGrowth = 100,
AutoFileGrowthType = FileGrowthType.KB,
FileGroup = "Not Applicable",
FileNameWithExtension = "",
SizeInMb = 10,
IsAutoGrowthEnabled = true,
MaxSizeLimitInMb = -1,
Path = ""
}
};
return databaseFiles.ToArray();
}
internal static UserInfo GetTestUserInfo(DatabaseUserType userType, string userName = null, string loginName = null)
{
return new UserInfo()