Commit Graph

2041 Commits

Author SHA1 Message Date
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
Alex Ma
42bbfdc418 [Loc] Xlf and resx update 9-5-2023 (#2209) 2023-09-05 13:44:05 -07:00
CSIGS@microsoft.com
54afb6504f LEGO: Merge pull request 2208
LEGO: Merge pull request 2208
2023-09-04 08:36:12 -07:00
CSIGS@microsoft.com
635d948a34 LEGO: Merge pull request 2207
LEGO: Merge pull request 2207
2023-09-03 08:35:51 -07:00
CSIGS@microsoft.com
f6b95928d3 LEGO: Merge pull request 2206
LEGO: Merge pull request 2206
2023-09-02 08:37:54 -07:00
Barbara Valdez
d1373dce69 Add advanced tab (#2203) 2023-09-01 16:54:02 -07:00
Kim Santiago
13ca980f19 update projects nuget to 0.1.12-preview (#2204) 2023-09-01 13:15:14 -07:00
Cory Rivera
ed74cfbc67 Only delete database backup and restore history after the database has been successfully dropped (#2202) 2023-09-01 11:22:17 -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
Barbara Valdez
3ba514c652 Add database settings tab (#2201) 2023-08-31 14:25:57 -07:00
Barbara Valdez
5f17826359 Add security tab (#2187) 2023-08-31 09:52:58 -07:00
Cory Rivera
724d533090 Simplify connection cleanup and clear pools to prevent lingering connections (#2199) 2023-08-30 14:38:24 -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
Alex Ma
1f045ba669 [Loc] update to SqlTools service layer and sqlcore for 8-29-23 (#2198) 2023-08-29 11:04:41 -07: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
CSIGS@microsoft.com
41ae066b46 LEGO: Merge pull request 2196
LEGO: Merge pull request 2196
2023-08-29 08:36:56 -07: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
Aasim Khan
1cd852c061 Adding project references in Sql core nuget package (#2192)
* Adding nuspec

* fixing nuspec

* building hosting

* temp

* Reordering step

* fixing pack destination

* Fixing csproj

* Fixing build

* Fixing path
2023-08-27 11:50:02 -07:00
Z Chen
6be15ce33f Update DacFx version to 162.1.124-preview (#2170)
* Update DacFx version to 162.1.112-preview

* Update DacFx to 162.1.124-preview
2023-08-23 19:24:45 -07:00
Cheena Malhotra
4e5a7ebe97 Throw exception on connection failure to be captured by frontend (#2190) 2023-08-23 18:28:47 -07:00
Aasim Khan
2502e23f43 Fixing sqlcore nuget dlls not being signed. (#2188) 2023-08-23 21:15:18 +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
Barbara Valdez
58923bc75e Enable Script option for Server Properties (#2184) 2023-08-22 18:47:45 -07:00
Cory Rivera
6497f5d72d Fix typo in ExecutionHandler class name (#2185) 2023-08-22 16:43:35 -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
Aasim Khan
ac8e4d6803 Adding missing directories needed for integration tests (#2181)
* Adding missing directories needed for integration tests

* Fixing dir names

* removing unused dir creation

* Adding back all projs

* adding missing dirs

* Fixing comments
2023-08-22 12:16:36 -07:00
Barbara Valdez
16c7e32356 Add processors tab (#2166) 2023-08-21 13:24:48 -07:00
Aasim Khan
b73058e31f Adding missing project dirs to fix integration tests (#2178) 2023-08-21 17:52:08 +00:00
Alex Ma
e42c58a430 [Loc] update to xlf and resx for 8-21-2023 (#2179) 2023-08-21 10:42:23 -07:00
CSIGS@microsoft.com
b27e0d7158 LEGO: Merge pull request 2177
LEGO: Merge pull request 2177
2023-08-19 08:37:06 -07:00
Aasim Khan
5d7d418894 adding missing ref (#2176) 2023-08-19 15:20:22 +00:00
Alex Ma
dee29a3a08 [Loc] update to xlf resources for 8-17-2023 (#2174) 2023-08-17 13:33:21 -07:00
CSIGS@microsoft.com
332df9042d LEGO: Merge pull request 2172
LEGO: Merge pull request 2172
2023-08-17 08:13:56 -07: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
Alex Ma
4ae9534ac8 Added retry policy for sleeping serverless error for SqlConnections (#2155) 2023-08-16 13:17:40 -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
Cheena Malhotra
0820d9796a Convert Async to sync (SqlClient apis) and cleanup async usage (#2167) 2023-08-09 15:03:02 -07:00
Alex Ma
65a7406063 [Loc] add newly generated sr.cs files (#2164) 2023-08-03 16:23:08 -07:00
Cheena Malhotra
93ee1275b0 Use connection string for change password connection (#2160) 2023-08-02 14:04:40 -07:00
Cheena Malhotra
6099746922 Improve Query editor Read performance + cancel timely for large data (#2161) 2023-08-02 14:04:30 -07:00
Charles Gagnon
969ac0ed8c Use Logger overloads (#2163) 2023-08-02 13:25:21 -07:00
Steven Marturano
dc91e1ecf0 Updated TDE NuGet to 1.0.0-preview.1.0.20230720.98 (#2157) 2023-07-31 14:29:27 -04: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
Z Chen
325f49ff20 Update DacFx to 162.1.80-preview and Projects to 0.1.11-preview (#2149)
* Update package versions

* Use projects 0.1.11-preview
2023-07-18 16:46:58 -07:00
Cheena Malhotra
efb5af0c47 Send user as empty string (default value) (#2151) 2023-07-18 14:59:22 -07:00