Commit Graph

243 Commits

Author SHA1 Message Date
Benjamin Russell
2ace786d95 Export headers in an empty result set (#1434)
* Minimal changes to make headers appear on empty result sets

* Columns for everyone!

* Updating tests - some don't pass yet

* Adding some more tests to verify the changes for column/row selection

* null default columns

* Updates to comments as per PR comments
2022-03-31 09:10:32 -07:00
Lewis Sanchez
8215d88dcf Adds new graph comparison request handler to the Execution Plan Service. (#1438)
* Adds new graph comparison request handler to the Execution Plan Service.

* Code review changes

* Renames execution plan compare params, result, and request classes.
2022-03-22 14:52:42 -07:00
Lewis Sanchez
f7b37091ca Renames ShowPlan directories along with corresponding namespaces (#1435)
* Renames ShowPlan directories along with corresponding namespaces

* Renames ShowPlanGraphUtils to ExecutionPlanGraphUtils

* Revert "Renames ShowPlanGraphUtils to ExecutionPlanGraphUtils"

This reverts commit 5dc2696ae906598447eed7360a3f342218432b83.

* Reverts show plan tests name change.

* Renames show plan test XML files.

* Renames ported directory to ShowPlan and updates namespace accordingly
2022-03-21 16:25:44 -07:00
Charles Gagnon
40c5d48c5e Fail build on unneeded usings (#1417) 2022-03-04 16:38:01 -08:00
Charles Gagnon
c248400a6c Add linting for copyright and unused usings (#1416)
* Add linting for copyright and unused usings

* Add one more + comment

* Enforce in build and fix errors

* Fix build
2022-03-04 15:17:29 -08:00
Aasim Khan
92a7248455 Adding recommendations to query plan (#1373)
* Adding recommendations

* Adding raw graph type in execution plan graph contracts

* Fixing function name and concising string formatting

* Converting localized string to a function

* Using better names in contract props
Formatting names in a better way

* Getting rid of unnecessary getter, setters and private props

* Fixing localized strings, comments and imports

* Fixing some contracts

* Fixing csproj formatting

* Fixing var names

* Fixing xml comments
2022-01-28 11:35:48 -08:00
Aasim Khan
0f54d60921 Parsing nested properties in show plan nodes. (#1351)
* Parsing nested properties in show plan nodes.

* Creating a base class for ExecutionGraphProp
Adding a simple test to see if the nested props are parsed correctly.

* Fixing doc comment

* simplifying class name
2022-01-19 14:31:19 -08:00
Alex Ma
18ca177767 Remove XElite for now (#1349)
* Revert "Revert "Revert "Update to XElite (#1287)" (#1334)" (#1337)"

This reverts commit 196364e81e.

* Add changed sr.xlf
2021-12-22 11:04:45 -08:00
Alex Ma
196364e81e Revert "Revert "Update to XElite (#1287)" (#1334)" (#1337)
This reverts commit 0d7a3b4168.
2021-12-17 12:33:57 -08:00
Alan Ren
0d7a3b4168 Revert "Update to XElite (#1287)" (#1334)
This reverts commit 822a6459ce.
2021-12-08 10:49:23 -08:00
Alex Ma
822a6459ce Update to XElite (#1287)
* added Xevent.xelite to packages

* WIP on XELite conversion

* added wip changes

* added streaminfo class for preserving streams

* added list for profilerService

* added cancelXelStreamRequest.cs

* added test configuration for profilerservice

* added request handler using startprofilingrequest

* fix start profiling result

* added small connection string

* WIP branch for XElite (not functional)

* added hardcoded string with working stream

* added check for buildconnectionstring

* added back HandleXEvent

* added profilerservice eventsavailable test

* WIP change for profilersessionmonitor

* added more changes to profilersessionmonitor

* changed HandleXEvent

* added more additions to profielrSessionMonitor

* added startmonitoringstream

* added startmonitoringsession

* added startmonitoringstream to IProfilerSessionMonitor

* switch to monitoringStream

* added assignment of connectioninfo

* added conninfo

* added conninfo to iProfilerSessionMonitor.cs

* added isStreaming flag

* added token list

* added XEventSession name.

* removed polling lock

* test adding filters

* removed old profile filter as its incompatible

* added wip cancel feature in removesession

* moved cancellationtoken outside

* added backIsStreaming

* moved isstreaming around

* added  multiple events in list

* added timeout to handleXEvent

* removed timeout

* remove eventList count check

* remove old events filter

* returned eventlist

* remove old events filter

* renamed xelite handle function

* restored sqlclient version

* removed original handlestartprofilingrequest

* added monitoring stream to handlecreatexeventsessionrequest

* removed unnecessary sections from monitor

* Revert "removed unnecessary sections from monitor"

This reverts commit 91cadeebeeedfe99cec2e9c42944ba6716d95a61.

* added xevent actions to profileEvent

* removed polling lock for processStreams

* added filter for oldevents

* removed unused methods

* removed comment

* removed unnecessary class

* removed unnecessary requests

* removed outdated methods

* added work in progress cancellation task

* added profilersessionmonitor changes

* added small changes

* renamed startMonitoringStream

* more changes related to feedback

* made changes to code

* removed more polling code

* fixed tests

* added connectioninfo to testxeventsessions

* changed functions

* added back else

* small formatting fix

* more changes made

* added changes to XEventSession

* update to strings

* added changes to accomodate tests

* more changes

* added profilerservicetest for stopprofiling

* added TestStoppedSessionNotification test

* added session missing details handler

* simplified error message

* restored strings and added changes

* added auto-getter setter for IsStreaming

* added more changes

* removed unnecessary lines from test

* added more debugging messages

* made last changes

* added error message for handlestopprofilingrequest

* added more debug messages

* added back an s

* added verbose
2021-12-07 14:11:42 -08:00
Alex Ma
faaf062f0f [Loc] Update to xlfs and resx files (#1332) 2021-12-06 19:05:58 -08:00
Alan Ren
b131d1738d add foreign keys and constraints (#1316)
* add foreign keys and constraints

* add property name
2021-11-18 15:01:10 -08:00
Aasim Khan
2e7bac5659 Sending show plan graph to ADS on Result Set updated event (#1300)
* Sending showplan graph over json rpc in Result updated event
Translating showplan graph into simple objects to be sent over JSON RPC

* Revert "Sending showplan graph over json rpc in Result updated event"

This reverts commit 2d63a625fd200d057bf6093e233f05dea440347c.

* Added string for localization

* Sending showplan graph over json rpc in Result updated event
Translating showplan graph into simple objects to be sent over JSON RPC

* Refactoring class

* Removing test warning

* Removing unused imports
Adding copyright

* Removing unused prop

* removing formatted string out .strings file

* Formatting files
Adding Errors in show plan graph

* Adding a separate event for execution plan

* Now sending mulitple graphs when a batch has more than one query.
2021-11-16 22:33:28 -08:00
Alan Ren
a3c69f3dd2 use path to identify edit target (#1292)
* use path to identify edit target

* async action

* revert RequestContext change

* comments

* address comments

* fix test
2021-11-10 17:39:48 -08:00
Aasim Khan
e8c50caea1 Porting showplan code from ssms (#1280)
* Porting showplan code from ssms

* Moving showplans bits to a subfolder

* code cleanup

* Remvoing unnecssary conditional visibility
2021-11-04 14:54:52 -07:00
Aasim Khan
e246bc5325 Adding star expression expansion (#1270) 2021-10-27 16:59:05 -07:00
Alan Ren
192f7fccd4 handle add column request (#1272)
* handle add column request

* comments

* rename data to ViewModel
2021-10-19 09:54:57 -07:00
Alex Ma
431e4cfbf1 Add changeConnectionUri action for query (#1227)
* added wip rename query

* added first rename test

* added missing query handling and two new tests

* removed ServiceDispose

* added change to owneruri.

* made fields private, used accessor methods

* added readonly flag back

* added didSave to sqltools.servicelayer

* fix for docsavecallbacks

* removed tryremove

* test disconnect in queryExecutionService

* removed debug message working query.

* added comment to handlerenamerequest

* added uri replacement function

* removed duplicate removemap function

* added minor fixes

* changed connectionOwnerUri to getter setter

* removed handledidsave and added setters

* removed additional save parts

* fixed space issues

* more fixes for spaces

* restored spaces

* fixed workspaceservice

* Update TextDocument.cs

* changed renameRequest into notification WIP

* restored textdocument

* restored textdocument.cs

* added rightwards arrow

* renamed rename to ChangeConnectionUri

* added more renames

* rename changeconnectionuri to changeuri

* renamed file names

* Revert "renamed file names"

This reverts commit 55228e65025b5179b15ae9a0adc095d95538723d.

* Revert "rename changeconnectionuri to changeuri"

This reverts commit 23f3813f609e3947f103e057f7c0919184075bdc.

* removed logging message and other small changes

* renamed class and method
2021-08-30 11:06:07 -07:00
Alex Ma
c731744298 Fix for deleting text columns (#928)
* Added handling for deleting problematic rows

* minor formatting changes

* Null checks and executereader implemented

* minor formatting

* Fix for column deletion for text

* minor space format

* more format changes

* Removal of top 200 and change of text comparison

* space fix

* minor commit

* Added new tests for single clause

* simplified regex

* spacing fix

* some polish for RowEditBaseTests

* space fix

* loc update (#914)

* loc update

* loc updates

* Warning for multiple delete (#931)

* Fix for multiple delete bug

* minor space removal

* removed catch error in RowDelete

* small optimizations

* space adding

* WIP on creating test

* Some cleanup

* removed spaces

* Fix for verifytext

* Added check for command format correctness.

* tidying up

* added working test for command exception

* simplification of TestDbDataReader getint

* Corrections made

* spacing and naming issues

* minor space

* one more space issue

* Revert "Support ActiveDirectoryPassword authentication (#899)" (#915)

This reverts commit b786a14c03.

* revert changes to connectionService

* fix for asserts

* fix clauses

Co-authored-by: khoiph1 <khoiph@microsoft.com>
Co-authored-by: Amir Omidi <amir@aaomidi.com>
2021-07-16 14:11:32 -07:00
Aasim Khan
9877af54b9 Updating to dotnet 5.0 (#1218)
* adding network file validator contract

* updating to dotnet 5

* reverting change in pipeline

* updating target framework to 5.0

* updating srgen and using target framework var

* reverting srgen back to 3.1

* Adding dotnet 3.1 to build

* Fixing task def

* removing global json

* updating other 3.1 refs to 5.0

* removing netcore folder from build.cake

* Moving and renaming dotnet 3.1 task
2021-06-25 13:53:01 -07:00
Alex Ma
993b094db9 Localization added to sqlservicetools (#1216)
* added other languages to ServiceLayer

* fixed travis and appveyor yaml, added other languages for localization

* added spanish and german strings to credentialslocalization, also WIP for coreservices test

* added WIP localization test for CoreServices

* Removed unit test for coreservices, need to work on those later.

* restored travis and appveyor

* added kusto string resource localization test

* added localization test and locale change for SqlToolsCredentials

* added locale command options to ResourceProvider

* revert resourceprovider test

* Localized SqlTools.Credentials

* added hosting localization

* replaced new with translation to be consistent with main service layer

* reverted external changes as it is unnecessary

* Translated ManagedBatchParser

* test culture value

* test culture change

* temporarily comment out service layer command options

* returned sr.cs

* temporarily remove bad tests

* restored tests and allowed for SR culture to change for dependencies (for future testing)

* localization for resourceprovider components added.

* Set LocaleSetter to public and also removed InternalsVisible for Kusto, Credentials and ResourceProvider

* removed unnecessary changes

* Removed CredentialsCommandOptions

* renamed pt-BR to pt-br

* Rename sr.pt-BR.xlf.template to sr.pt-br.xlf.template

* Rename src/Microsoft.SqlTools.ServiceLayer/Localization/LCL/pt-BR/sr.resx.lcl to src/Microsoft.SqlTools.ServiceLayer/Localization/LCL/pt-br/sr.resx.lcl

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* restored newlines

* Update sr.pt-br.xlf.template

Removed newline

* removed newline

* fixing newlines for consistency

* removed unnecessary newline
2021-06-10 15:50:53 -07:00
Charles Gagnon
dc6555a823 Escape file URIs (#1189)
* Escape file URIs

* Fix test

* Add tests
2021-04-16 15:33:11 -07:00
Karl Burtram
6fe715d2d8 Do not update the DB name when connecting to DB pool (#1186)
* Do not update the DB name when connecting to DB pool

* Fix typo in the connection service
2021-04-15 14:48:02 -07:00
Charles Gagnon
1e9221b2a5 Remove password field from test (#1163) 2021-02-23 08:53:41 -08:00
Charles Gagnon
5c7211e82a Include singleline comments outside batch for nb convert (#1139)
* Include singleline comments outside batch for nb convert

* Remove extra space
2020-12-14 15:16:07 -08:00
Aleksei Guzev
11960fd904 Fix handling some SQL Assessment warnings (#1114)
* Some new SQL Assessment warnings may have Check property set to null. Handle the warnings with no exception.
* Make names of SQL Assessment test methods more informative.
2020-11-04 22:13:46 +03:00
Alex Ma
47e7a2f492 Fix for multiple parameter error. (#1082)
* Clearing first use of parameters

* restore space

* added finally block

* Added try catch block in correct position

* fixed spacing

* added space before try

* duplicate row check simplified by Alan

* Revert "duplicate row check simplified by Alan"

This reverts commit 445ac506bd96b353266778abd0cf9bad2be2a3c3.

* removed exception and changed message

* added exception back for test purposes

* added working executescalar

* Added "<=" for delete action that deletes nothing.

* spacing fix for check duplicate

* Added comments and changed function logic.

* added clarifying message

* Added new extended class

* small space fix
2020-09-25 10:52:59 -07:00
Aleksei Guzev
07700560a6 Fix script generated for SQL Assessment results (#1058)
* INSERT VALUES has the limit of 1000 rows. Replace with derived table.
* Remove NOT NULL restriction from the generated table.
* Fix line endings in SQL Assessment source files.
2020-08-28 20:17:54 +03:00
Udeesha Gautam
616a79c83d GetConnectionString API fix to not change the cache only return the value (#1040)
* Get connection string call was changing the connection info (ref object) received from cache. Changing it to just get and make changes to only the returned string..

* Change to ensure PR validation works
2020-08-09 19:17:16 -07:00
Alex Ma
81b4bb7753 Warning for multiple delete (#931)
* Fix for multiple delete bug

* minor space removal

* removed catch error in RowDelete

* small optimizations

* space adding

* WIP on creating test

* Some cleanup

* removed spaces

* Fix for verifytext

* Added check for command format correctness.

* tidying up

* added working test for command exception

* simplification of TestDbDataReader getint

* Corrections made

* spacing and naming issues

* minor space

* one more space issue
2020-08-06 13:55:49 -07:00
David Shiflet
839acf67cd Convert most tools service tests to nunit (#1037)
* Remove xunit dependency from testdriver

* swap expected/actual as needed

* Convert Test.Common to nunit

* port hosting unit tests to nunit

* port batchparser integration tests to nunit

* port testdriver.tests to nunit

* fix target to copy dependency

* port servicelayer unittests to nunit

* more unit test fixes

* port integration tests to nunit

* fix test method type

* try using latest windows build for PRs

* reduce test memory use
2020-08-05 13:43:14 -04:00
Udeesha Gautam
4c819e0fc1 Fixes for tests affected by MDS update (#987)
* Fixing tests in parallel that were affected by MDS update
2020-06-23 11:27:19 -07:00
Soheil Alizadeh
31659e1126 Prevent ArgumentNullException in refresh request (#963) 2020-06-14 23:24:31 -07:00
Soheil Alizadeh
887a499d2b Update Infrastructure (#961)
* Update form .NET Core 2.2 to .NET Core 3.1

- Global variable for projects
- Change TFMs from netcoreapp2.2 to netcoreapp3.1
- Update global.json
- Update build.json
- Remove direct framework cake TestCore task
- Update travis dotnet version
- Update azure pipline file
- Update vscode launch.json

* Add Central Package Management

* Fix xUnit Breaking Change for MemberData type

* Fix xUnit breaking change for duplicate test method name

* Fix Rang/Index type conflict with System.Rang/Index

* Update vscode tasks.json

* Change serviceHostExecutable path in ServiceTestDriver.cs

* Downgrade SDK version (https://github.com/appveyor/ci/issues/3440)

- Appveyor hasn't installed latest SDK therefore I downgrade it until they install it.

* Dump Microsoft.SqlServer.DACFx
2020-06-12 11:44:18 -07:00
Jeff Trimmer
82eed06847 Add Always Encrypted Parameterization Functionality (#953) 2020-05-05 12:01:24 -07:00
Alan Ren
8f6662b019 extend the list databases request (#951)
* extend the list databases request

* reuse databaseInfo and refactor

* fix typo
2020-04-28 16:12:56 -07:00
Aleksei Guzev
bcc1f2a486 Add AQL Assessment service (#946)
[SQL Assessment API](https://docs.microsoft.com/en-us/sql/sql-assessment-api/sql-assessment-api-overview) provides a mechanism to evaluate the configuration
of SQL Server for best practices. SQL Assessment API gives a list
of recommended actions to improve SQL Server performance or security.

The SQL Assessment service is used by the expected SQL Assessment
feature of Azure Data Studio. 

SqlAssessmentService forwards JSONRPC calls to SQL Assessment engine
and wraps results as a response.

`assessment/getAssessmentItems` returns a set of checks 
applicable to a given target.

`assessment/invoke` returns a set of recommendations
for improving SQL Server instance or database configurations. 

`assessment/generateScript` returns a T-SQL script for storing
an assessment result set to a SQL data table.
2020-04-24 10:52:55 +03:00
Charles Gagnon
7d37de218a Fix to not add parens for global variable built in functions (#940) 2020-04-07 09:56:24 -07:00
Leila Lali
73fc70fbbc Adding service operations for external languages (#918)
* Added service operations for external languages
2020-02-21 08:52:58 -08:00
Jeff Trimmer
927b0d73ca Enable Always Encrypted enclave connection parameters (#919)
* Enable the enclave connection parameters.

* Update the switch statement to use the enum constants for EnclaveAttestationProtocol

* Update verbiage for Always Encrypted connection options

* Update the argument exception to chose one specific to this connection option

* Add resource logic to resource files.

* Add error checking for when enclave parameters are added and Always Encrypted is set to disabled.

* Add/Update unit tests
2020-02-18 15:33:12 -08:00
Jeff Trimmer
7b102df5a7 Enable column encryption setting (#908)
* Enable the Column Encryption advanced security connection setting and add supporting tests.
2020-01-22 16:02:05 -08:00
Charles Gagnon
314d01739d Fix auto-complete inserting brackets around function names (#895)
* Fix reserved words not to be bracket quoted

* wip

* More fixes

* Better name

* Format files and update test
2019-11-26 17:16:05 -08:00
Karl Burtram
427f0c11e8 Bump SMO and SqlClient to pickup Microsoft.Data.SqlClient fixes (#894)
* Revert "Revert to SMO with older SQLClient driver (#889)"

This reverts commit b763abae47.

* Bump SMO and SqlClient
2019-11-22 17:17:21 -08:00
Karl Burtram
b763abae47 Revert to SMO with older SQLClient driver (#889)
* Revert "Update SMO (#875)"

This reverts commit 96593d66e3.

* Revert "Switch Tools Service to new SMO and Microsoft.Data.SqlClient driver (#865)"

This reverts commit 9d140b53f3.

* Bump SMO to 160.1910315.0-preview
2019-11-04 13:00:45 -08:00
aleklj
84c505f647 Hotfix for ads dashboard for sqlondemand (#885)
* Hotfix for ads dashboard for sqlondemand

* Generalizing engine edition functions and adapting tests

* Minor comment and cosmetic fixes

* Adding SqlOnDemand server edition string
2019-10-31 17:35:11 +01:00
BranislavGrbicMDCS
a0e56c5747 Removing External table folder for sqlOnDemand (#879)
* Removing External table folder for sqlOnDemand

* Enabling external table flag
2019-10-17 20:33:09 +02:00
BranislavGrbicMDCS
962ba3a12b Adding Support for new engine edition (#876)
* Adding Support for SqlOnDemand

* Updating unit test per comment

* Resolving comments. Enabling external table for sqlondemand

* Resolving comments. Enabling External tables for sqlondemand

* Enabling external tables for sqlondemand
2019-10-16 23:29:57 +02:00
Charles Gagnon
de1bab9f1e Fix Intellisense not working for saved files (#867)
* Fix tools service to store the corrected file path

* Use ClientFilePath for key

* Further fixes

* Undo spacing changes

* Fix tests

* Trigger CI rebuild
2019-09-19 11:28:40 -07:00
David Shiflet
9d140b53f3 Switch Tools Service to new SMO and Microsoft.Data.SqlClient driver (#865)
* switch to ambient props and targets files

* build against Microsoft.Data.SqlClient

* build tests

* fix test bug

* temporarily add SMO nuget to the repo

* update to released Microsoft.Data package
2019-09-17 17:51:19 -04:00