376 Commits

Author SHA1 Message Date
Benjin Dubishar
c7857c249c Updating SQL Projects nuget dependency (#2253)
* Updating SQL Projects nuget dependency

* Bumping nuget version

* Adding missed swapover
2023-09-29 13:04:14 -07:00
Aasim Khan
138a70efa0 Fixing connections for stateless object explorer to work with fabric tokens (#2252) 2023-09-27 02:07:36 +00:00
Cheena Malhotra
78581e8508 Minor improvements (#2250) 2023-09-26 10:16:20 -07:00
Cory Rivera
c29fb03b6e Remove redundant usage of object URNs in database handler (#2245) 2023-09-20 17:17:54 -07:00
Sai Avishkar Sreerama
a053457ba1 Enable QueryStore tab to the database properties (#2200)
* initial commit

* adding prototypefile and server conditions

* Saving query store options completed, todo:tests

* adding LOC stings  according to the LOC version of the ms doc

* removing common constants

* merge conflict fix

* fixing null reference exception

* Adjusting the null reference exception property value in prototype.cs

* removing unused directive

* test fix that checks wrong value

* Purge query store data changes

* adding comment and uncommented the line
2023-09-07 16:35:44 -05:00
Aasim Khan
4dbd1b05a4 Adding ability to do stateless OE expansions from a parent node other than root (#2211) 2023-09-06 22:25:02 +00:00
Lewis Sanchez
a56cf5a277 Consolidate context request endpoints into a single request endpoint (#2205)
* Create new endpoint consolidating previous 2

* Clarify comment

* Removes two separate endpoints to get and generate

* Rename classes for get context request

* Update src/Microsoft.SqlTools.ServiceLayer/Metadata/MetadataService.cs

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

* Update src/Microsoft.SqlTools.ServiceLayer/Metadata/MetadataService.cs

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

* Code review changes

* Throw exception and localize ex messages

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
2023-09-05 15:56:35 -07:00
Benjin Dubishar
25c18d3390 Query Store Service (#2171)
* Checkpoint

* Checkpoint

* Checkpoint

* checkpoint

* Hooking in calls to QueryExecutionService

* adding cases

* Fleshing out report handlers

* Adding parameter converters

* Adding sqlparam declarations for Top Resource Consumers and Forced Plans

* swapping to object-object to centralize conversion for sqlparams

* Adding sqlparams for GetTrackedQueries

* Added sqlparams for High Variation

* Added Overall ResourceConumption

* Adding params for regressed queries

* Removing WithWaitStats calls, since they're automatically used within QSM when waitstats is an available statistic#

* Adding PlanSummary handlers

* cleaning up orderable queries

* initial test mockout

* adding basic (incorrect) parameter translation

* first test passing, datetimeoffset swapped to ISO format

* Adding test baselines

* Updating nuget package

* Adding get/set

* Adding get/set for result object

* Switching to parameter-less constructor

* Swapping TimeInterval for string-based BasicTimeInterval

* Removing unnecessary usings

* Adding back params comments

* Fixing up request docstrings

* comment tweak

* fix tests failing in pipeline because of line endings not matching

* removing unnecessary usings

* Setting tests to generate queries in UTC for test stability

* Normalizing line endings

---------

Co-authored-by: Kim Santiago <kisantia@microsoft.com>
2023-09-01 10:56:39 -07:00
Lewis Sanchez
c0a0f27e49 Return context after it has been generated (#2194)
* Emit generate scripts complete event to client

* Rename Message to ErrorMessage

* Sets owner URI for complete params obj

* Setting complete flag explicitly

* Making errorMessage prop nullable

* Localizes error messages

* Return context scripts and remove script tabs

* Send event when script gen isn't needed

* Change notification to request endpoint

* test get context when context doesn't exist

* Stop reading old context files
2023-08-31 16:28:05 -07:00
Sai Avishkar Sreerama
c73ab55055 Enabling FILEGROUPS tab experience to the Database Properties (#2182)
* 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

* Initial commit

* failing tests fix

* Modify tests by create database using SqlTestDb

* 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>

* preparing filegroup data to model

* fixing test

* commenting remove file testing as failing pipeline but passing locally

* saving filegroups

* using enum for type

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

* all working but saving needs condition for filestream types

* removing fulltext param and test fix

* saving filegroups completed, need tests

* fixing the path..

* adding test for Filegroups

* test fix

* fixing filegroups as filestream is not enabled on test server

* missing conflict resolving

* cleaning unused method

* Code review updates for both filegroups and files logic

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
Co-authored-by: Cory Rivera <corivera@microsoft.com>
2023-08-30 14:00:56 -05:00
Sai Avishkar Sreerama
07c8069cfa 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>
2023-08-29 11:24:31 -05:00
Cory Rivera
52773bc26d Add Attach Database functionality to Object Management Service (#2193) 2023-08-28 12:24:02 -07:00
Aasim Khan
766f68551e Removing script as feature from service layer to sqlcore (#2189) 2023-08-28 04:28:25 +00:00
Cheena Malhotra
cea10c13e6 Fixes BindingQueue, GetSignatureHelp and RefreshIntellisenseCache to be truly async (#2175) 2023-08-23 13:46:13 -07:00
Cheena Malhotra
fcd84f242a Fix signature help test to run synchronously (#2186) 2023-08-23 11:48:29 -07:00
Aasim Khan
c7d75fa535 Publishing SQL Core library in nuget (#2173)
* Set up CI with Azure Pipelines

[skip ci]

* Update publishSqlCoreProject.yml for Azure Pipelines

* Update publishSqlCoreProject.yml for Azure Pipelines

* Update publishSqlCoreProject.yml for Azure Pipelines

* Update publishSqlCoreProject.yml for Azure Pipelines

* Update publishSqlCoreProject.yml for Azure Pipelines

* Updating json rpc target framework

* Fixing packages to pack

* fixing pattern

* Fixing project pattern

* adding versioning schema

* fixing versioning scheme

* fixing nuget package name

* adding name

* removing var

* Fixing stuff

* Fixing stuff

* Fixing stuff

* Fixing build name

* removing build name

* fixing name

* fixing stuff

* fix pattern

* Fixing stuff

* Fixing feed

* Fix stuff

* Fixing feed

* fixing proj name

* Fixing stuff

* Fixing netframework version

* Fixing target framework

* Adding target framework to dependency

* Fixing frameworks

* adding net7.0

* adding flag

* Fixing target frameworks and making code compatible with lang version

* fixed flag

* Fixing assembly name

* Adding hosting in nuget package

* Fixing tests

* Moving steps to its main pipeline

* only releasing when release is true

* Fixing build scripts

* Adding version to csproj for packaging

* adding version

* Fix dirs

* Adding version number to right prop group

* Adding necessary dis

* Fixing build number

* fixing datatype

* Using different var

* Removing unused yml

* Adding back nullables to hosting

* Adding back more nullables

* adding back more nullables

* moving some props to dir level

* Fixing tests

* Removing dup properties

* Supporting different target frameworks in hosting

* Removing additional setting in csproj

* signing sql core dll in publish

* Fixing version setting

* Adding to build

* Added signing and packaging flag

* Fixing file pattern
2023-08-22 23:15:20 -07:00
Lewis Sanchez
08e855aa1d Implements Contextualization API into Azure Data Studio to get better query recommendations from extensions like Copilot (#2159)
* Add contract to get all metadata request

* Add new metadata service request endpoint

* Adds factory to make database server scripts

* Minor clean up

* Corrects filename typo

* Cleans up SmoScripterFactory

* Stubs out metadata cacher

* Method clean up

* Add writing and reading to script cache

* Cleans up request endpoint flow

* Add missing edge case when cache isn't empty

* Remove unused code

* Remove unneeded null check

* Read to end of stream

* Passes correct parameter to write cache

* Adds integration test to get all scripts

* Renames new request endpoint

* Rename request class to AllServerMetadataRequest

* Renames server metadata request endpoints

* Refresh cache and adjusts return obj type

* Clean up

* Assert table script generation

* Minor cache refresh adjustment

* Ensure test create table script is accurate

* Code review changes

* Additional code review changes

* Swap logger write for logger warning

* Renames generate request endpoint methods

* Remove unused using statement

* Remove unnecessary create table check

* Check if previous script file is valid for reuse

* Pascal case for method name

* Code review changes

* Fix PR issues

* Update doc comment

* Fixes tests after code review changes

* Fix failing int. test due to 30 day temp file expiry

* Generalize type names and update request endpoint

* Updates doc comment.

* Remove 'database' from type and method names

* Code review changes

* Code review changes

* Issues with background thread.

* Remove thread sleep for test reliability

* Remove reflection from int. tests
2023-08-22 12:28:32 -07:00
Barbara Valdez
16c7e32356 Add processors tab (#2166) 2023-08-21 13:24:48 -07:00
Aasim Khan
5d7d418894 adding missing ref (#2176) 2023-08-19 15:20:22 +00:00
Aasim Khan
73c2a75fba Creating a new Sql Core project that stores OE classes. (#2165)
* init

* More fixes

* moving filters from contracts to core OE classes

* Fixing some tests

* More fixes and added doc comments

* Fixing tests

* Quick refactoring

* more cleanups

* cleanup

* Adding stateless OE

* Adding null checks

* Making group by schema independent of settings

* Fixing tests

* Removing node info from core oe code

* Fixing tests and moving OE code to its own project

* moving oe to own project

* Removing changes to Kusto

* Removing azure access token from service layer

* Fixing project description and title

* Fixing file name typo

* Removing unused  strings from service layer

* Fixing localized strings in tests
Adding comments to stateless OE

* Fixing stuff

* Update src/Microsoft.SqlTools.SqlCore/Microsoft.SqlTools.SqlCore.csproj

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

* Fixing project nesting

* Fixing more stuff and removing OE class

* Cleanup

* Code cleanup

* fixing oe service provider

* Fixing test name

* Remove using

* Update src/Microsoft.SqlTools.SqlCore/ObjectExplorer/SmoModel/SmoQueryContext.cs

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

* Fixing syntax error

* Adding project to locproject

* Fixing stuff

* Fixing errors

* sorting usings

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
2023-08-16 22:11:35 -07:00
Sai Avishkar Sreerama
e4db70fb39 Enabling Database scoped configurations tab to DB Properties (#2147)
* 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

* Adding test case and fixing createDatabase issue

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

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

* comment update

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
2023-08-15 11:58:35 -05:00
Cory Rivera
7c0da6b6b1 Add extra delete database functionality to DatabaseHandler (#2168)
* Also fixed connections not being properly closed in Detach operations
* Fixed errors being thrown in InitializeObjectView because certain db property fields are not supported against Azure
2023-08-11 13:06:35 -07:00
Charles Gagnon
969ac0ed8c Use Logger overloads (#2163) 2023-08-02 13:25:21 -07:00
Cory Rivera
46fa477717 Provide default indexes for database option values instead of reordering options lists (#2156)
* Also re-add <default> to owners list for new database dialog
2023-07-27 16:11:49 -07:00
Barbara Valdez
e14828e0d4 Send min and max values for server properties (#2130) 2023-07-07 13:03:25 -07:00
Barbara Valdez
8dfd50ff50 disable test (#2131) 2023-07-07 08:45:20 -07:00
Barbara Valdez
4c4d6584b3 Update memory settings and implement ServerPrototype (#2126) 2023-07-06 17:25:45 -07:00
Sai Avishkar Sreerama
11f632aaa9 Sai/db properties options tab (#2121)
* Sending values to ADS, including the arrays, need refactor and tests

* adjusting dd options as per ssms

* sending back the updated options properties to smo

* saving changes

* pulling correct database name changes

* Refactoring

* saving is working fine

* Added genral tab section options for the option tab

* modifying userAccess and pageVerify props types

* fix for database name being master for always for existing database

* Managed Instance save error fixed

* added new assertions to the test case

* server engine edition conditions handling from ADS side

* Adding unsupported options approach to the properties, so that these nullable options can be excluded from UI

* modifying the props name

* modified empty string to null

* Test case update
2023-07-06 13:48:11 -04:00
Barbara Valdez
c2d53a3215 Get server general properties (#2117)
* add server handler

* get server general properties
2023-06-28 16:39:37 -07:00
Aasim Khan
6b251bd24a Adding like filter and removing contains to OE filtering (#2105)
* Adding startswith and like filter

* Adding ends with

* Adding tests

* Remove null and not null

* Fixing string

* Update test/Microsoft.SqlTools.ServiceLayer.UnitTests/ObjectExplorer/NodeFilterTests.cs

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

* Update test/Microsoft.SqlTools.ServiceLayer.UnitTests/ObjectExplorer/NodeFilterTests.cs

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

* Adding back contains, starts with and ends with

* Properly escaping chars for like based filters

* Adding some comments regarding escape characters

* Using generated regex

* removing additional class

* Adding extra auth type that was causing the tests to error out

* Fixing regex

* Adding integration tests

* Fixing unit tests

* Making fluent assertions

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
2023-06-28 16:17:20 -07:00
Sakshi Sharma
4334d79d76 Add "Open XEL file" support to profiler in sqltoolsservice (#2091)
* Open XEL file changes

* placeholders for openxel

* add observable xe reader

* md format tweaks

* implement localfile as a new session type

* add ErrorMessage to session stopped notice

* fix flaky test

* handle already running session

* fix stopped session event send on file completion

* fix flaky unit test

* Update XElite and dependent versions

* Fix errors after merge and remove failing tests for now

* Fix main merge mess-up.
Address comments.
Add one more relevant test.

* Remove extra namespace.

* Remove unnecessary import

* Fix build error

* Address comments.

* Remove disabiling JSON002 compiler warning

* Address comments and update json handling

* Fix build error

* Fix integration test (emerged due to Main merge mess up)

* Clean up code (no functional changes)

---------

Co-authored-by: Karl Burtram <karlb@microsoft.com>
Co-authored-by: shueybubbles <david.shiflet@microsoft.com>
2023-06-27 14:25:18 -07:00
Kim Santiago
95a094438e Fix for schema compare dropping constraints (#2120)
* fix for scripts that are displayed in schema compare drop constraints bug

* update DacFx version

* add more comments
2023-06-26 14:01:28 -10:00
Cory Rivera
9d0d4b0cae Enable Detach Database in database handler (#2110) 2023-06-22 17:28:41 -07:00
Sai Avishkar Sreerama
5c7dae40e6 Enabling database properties general tab with real time values from SMO (#2093)
* initial commit with all required db handler and props, also getting the data from ADS

* database properties view updated

* Delete Microsoft.SqlTools.ServiceLayer.sln

This file should be ignored

* Removed unwanted file

* Using DatabaseHandler for properties as one handler per object

* removed unused and unnecessary changes

* minimal updates

* moving type conversion to UI side, properties with original types.

* conversion number fixed

* Adding Localized strings

* using existing objectUrn logic to get the smo object

* Adding Integration tests for database properties verification

* refactoring

* updating test
2023-06-21 19:41:18 -05:00
Alan Ren
7f6b357eb0 fix delay in query execution (#2109)
* fix delay in query execution

* fix test case
2023-06-19 16:31:47 -07:00
Cory Rivera
c92bc71454 Exclude Data Warehouse as an option when creating an Azure database (#2100) 2023-06-13 16:04:23 -07:00
Cory Rivera
808172bc20 Retrieve Azure SLO details in Database Handler (#2094) 2023-06-12 11:44:17 -07:00
Cory Rivera
0ad169781e Replace <default> values in Owner and Collation fields for Create Database dialog (#2086) 2023-06-02 16:19:00 -07:00
Kim Santiago
a12244f3d0 Add support for adding system db references as PackageReference (#2078)
* Expose adding system db references as PackageReference

* update nuget
2023-06-01 11:38:28 -07:00
Cory Rivera
0a5a7b4cc5 Address remaining comments for Object Management Database Handler (#2081) 2023-06-01 11:02:59 -07:00
Cory Rivera
d5cfc52ca7 Add object management handler for creating a database (#2071) 2023-05-31 12:55:12 -07:00
Hai Cao
d525e88672 Add securable search and permission setting to User Management (#2052) 2023-05-10 18:20:06 -07:00
Benjin Dubishar
c21203c5c2 Adding ability to only load properties and metadata for a SqlProject (#2040)
* Adding property quick-loading

* Remove whitespace
2023-05-03 18:44:17 -07:00
Alan Ren
5dbed25c40 change user type implementation (#2036)
* change user type implementation

* fix build errors
2023-05-01 10:27:00 -07:00
Sakshi Sharma
3e0135b907 Update STS changes to be backward compatible with scmpOpen (#2031)
* Update STS changes to be backward compatible with scmpOpen

* Update cleanup code

* Fix test.
2023-04-24 16:58:06 -07:00
Benjin Dubishar
c5cdc4712a Adding move and exclude folder to SqlProjectService (#2027)
* Adding move and exclude folder

* Fixing cross-plat path bug in test
2023-04-21 11:46:11 -07:00
Benjin Dubishar
006488340c Updating DacFx.Projects to 162.0.28 (#2019) 2023-04-19 20:12:56 -07:00
Alan Ren
e314f839d8 Simplify Object Management APIs (#2015)
* unify requests-wip

* wip

* unify api

* fix test

* add credential handler

* fix credential handler issue.

* generic type update

* fix scripting for user
2023-04-19 15:43:01 -07:00
Cheena Malhotra
648d7dbd3c Address warnings and (some) nullables (#2013) 2023-04-18 20:57:13 -07:00
Kim Santiago
13672c1d05 Add support for nupkg database references in sql projects (#2006)
* add support for nupkg database references in sql projects

* update DacFx.Projects
2023-04-14 16:18:06 -07:00