Commit Graph

211 Commits

Author SHA1 Message Date
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
Kevin Cunnane
d42e3626cb Fix serialization tests & don't block thread (#846)
* Fix serialization tests & don't block thread
- Fixed potential null ref when closing streams
- Always clean up serialization queue if an error occurs
- Stop blocking dispatcher thread by not awaiting task that processes the message
- Improved error logging in EventFlowValidator to help debug issues
- Close stream on exception
2019-08-09 09:48:57 -07:00
Kevin Cunnane
7ef82feea7 Add serialization service support (#840)
Added a method that handles serialization requests
Support splitting save over multiple requests to reduce overall message size
Added unit tests
String changes used a new version of the string tool for generation.
Will publish PR separately for the changes to build & localization
so this can run on Mac without .Net Core 1.0
2019-08-06 16:50:42 -07:00
Shengyu Fu
e1b9890f5c Adding completion extension loading and execution logic (#833)
* Adding ICompletionExtension interface

* Adding extension loading and execution logic

* Fixing compilation error in VS 2017

* Using MEF for completion extension discovery

* using await on GetCompletionItems

* Adding an integration test for completion extension and update the completion extension interface

* Update the completion extension test

* Fix issues based on review comments

* Remove try/cache based on review comments, fix a integration test.

* More changes based on review comments

* Fixing SendResult logic for completion extension loading

* Only load completion extension from the assembly passed in, add more comments in the test

* Adding right assert messages in the test.

* More fixes based on review comments

* Dropping ICompletionExtensionProvider, load assembly only if it's loaded at the first time or updated since last load.

* Fix based on the latest review comments

* Adding missing TSQL functions in default completion list

* Update jsonrpc documentation for completion/extLoad
2019-07-19 12:04:03 -07:00
udeeshagautam
432e054d55 Feature/schemacompare scmp save (#824)
* First cut of scmp Save related changes and some test refactoring

* Adding Exclude/Include objects in saving

* Add diff entry validation as part of test

* Adding PR comments - major change is change to nameparts in place of name hence preserving any "."/"[" in name and avoiding any string operations

* One more UT scenario addition for create excluded object
2019-06-13 17:28:59 -07:00
Karl Burtram
151a2de625 Query execution settings support (#812)
* WIP

* WIP 3

* WIP 3

* Additional query settings updates

* Add settings tets

* Address code review feeback

* Updates from testing
2019-05-16 15:21:17 -07:00
kisantia
5392f81d54 Fix schema compare script formatting (#809)
* Add GO after each statement and remove leading and trailing whitespace

* Addressing comments

* formatting
2019-05-13 10:04:02 -07:00
Charles Gagnon
85f34b65f1 Fix a number of cred scan hits (#800)
Bunch of secrets in files, usually fixed by generating random password. The deleted script files didn't seem to be used anywhere.
2019-04-24 13:31:34 -07:00
kisantia
dc5ab60df5 Fix invalid dacpac version crashing sqltoolsservice (#789)
* fix invalid dacpac version crashing sqltoolsservice
2019-04-03 17:30:10 -07:00
Karl Burtram
eaaff8b8a1 Remove Peek Definition error popup (#786)
* Remove Peek Definition error popup

* Fix broken test case

* Fix bug
2019-03-22 16:52:45 -07:00
udeeshagautam
5778dc7b01 Fix for : 4045: Cannot cancel a Query. Query runs too long. (And SMO update) (#780)
* Fix for : 4045: Cannot cancel a Query. Query runs too long.
HandleExecuteRequest was returning a task to awaiter - which was getting waited on. changed it to async function to start task in new thread and return nothing to awaiter . Also the cancellation token set by cancel request was getting checked only after making the connection to execute batches. Added an additional check for cancellation token befor the connection has been made.

Fix for 4319: Error showing dbs when using AAD in... 1.5.0-alpha.74
David has already created a new version of SMO nuget with the fix. - incorporating the same (150.18096.0-preview).

* Adding awaitable internal task for tests to run properly

* Adding more cancel tests
2019-03-13 15:39:00 -07:00
Karl Burtram
022282800a Move managed parser into its own project (test code coverage) (#774)
* Created New ManagedBatchParser project in .NetStandard

* Addressing PR Comments

* Resolve 'No Repository' warning.

* Move batch parser tests to integrations test project

* Fix SLN file
2019-02-07 20:13:03 -08:00
Arvind Ranasaria
5f6d500977 This change ensures that we send back only one 'isComplete=true' message for a given result set (#763)
Fixes:
The streaming protocol is now tightened to ensure that only the last message for a result set contain isCompleted=true. Now isCompleted=true is never sent in isAvailable message.
Tightened logic in sending messages to make sure that no duplicate messages get sent out due to concurrent processing.
Made a fix to a null reference exception when processing special action which was a pre-existing benign bug.
Testing: Added 1 more new test that runs existing tests concurrently 1000 times to make sure no random timing issues are observed and tightened verifications to existing tests to ensure no duplicate messages and only one isComplete=true message is sent across.

* tightening the protocal to ensure only one message (the last one) with completed=true is sent back for a single result set within a query batch
2019-01-11 10:21:52 -08:00
Karl Burtram
0fd98df79b Update SqlClient to 4.6.0 (#761) 2019-01-07 16:22:35 -08:00
Arvind Ranasaria
e4808c12aa Feat/result streaming - Fix for issue #746 in toolsservice and issue Microsoft/azuredatastudio#3348 (#753)
* fix for issues 746 & azuredatastudio issue 3348

* test coverage improvement for results streaming

* addressed minor review comments

* adding generated file test/CodeCoverage/package-lock.json to workaround code coverage issue.
2018-12-04 20:49:05 -08:00
Matt Irvine
1a9a750fa8 Fix CodePages version issue (#752) 2018-11-29 16:37:59 -08:00
Arvind Ranasaria
6dd9a4b5f1 Feat/result streaming (#721)
This changes adds the following two notifications from the results processing within a batch. These new notifications allows a consumer to stream results from a resultset instead of getting them all at once after the entire resultset has been fetched.

ResultsAvailable
This is issued after at least 1 row has been fetched for this resultset.

ResultsUpdated
This is issued periodically as more rows are available on this resultset. The final send of this notification when all rows have been fetched has the property 'Complete' set to true in the ResultSummary object.

Detailed Change Log:
* Initial completed implementation of QueryResults stream feature. 3 unittests still need fixing

* Fix for the 3 failing test. I will look into making MockBehavior strict again for the three tests later

* Making GetReader/GetWriter use filestream objects in FileShare.ReadWrite mode so the file can be concurrently read and written

* Changing resultsAvailable also to fire off on a timer instead of after 1st row

* adding a project for clr TableValuedFunction to produce result set with delays after each row. This is helpful in end to end testing.

* Fixing up some tests and simplifying implementation of result update timer

* Address review comments

* Some test fixes

* Disabled flaky test verification
2018-11-26 10:24:54 -08:00
Matt Irvine
7f28f249de Add support for Azure Active Directory connections (#727) 2018-11-13 11:50:30 -08:00
Karl Burtram
6153279840 Update broken BindingQueue test from previous commit (#725) 2018-10-31 15:24:02 -07:00
Karl Burtram
df023da0ba Revert "Rollback SMO to latest 14.0 version (#722)" (#723)
This reverts commit 407e9feb40.
2018-10-30 17:20:25 -07:00
Karl Burtram
407e9feb40 Rollback SMO to latest 14.0 version (#722)
* Rollback SMO to latest 14.0 version

* Add back nunit package reference
2018-10-30 12:13:23 -07:00
Karl Burtram
2b6eeb19ab Update references to use non preview references (#718) 2018-10-24 17:23:23 -07:00
2966a53b70 Fix: DATETIMEOFFSET data types should be ISO formatted (#714) 2018-10-22 16:46:02 -07:00
Karl Burtram
a241a4510b Bump .Net Core SDK to 2.2.100 Preview (#715)
* Bump .Net Core SDK to 2.2

* Update travis file

* Try to fix broken AppVeyor code coverage
2018-10-22 15:54:17 -07:00
Arvind Ranasaria
1ef70ef259 Bug fix for https://github.com/Microsoft/azuredatastudio/issues/2923 and misc other fixes (#711) 2018-10-19 13:25:18 -07:00
Karl Burtram
7c1710d396 Reopen connections prior to creating query execution data readers (#704)
* Reopen connections prior to creating query execution data readers

* Reopen connection if an exception was rasied executing the query

* Fix unit tests
2018-10-08 12:41:04 -07:00
Matt Irvine
f45155aa4a Fix OE and Binding Queue reliability bugs (#702) 2018-10-05 14:14:36 -07:00
David Shiflet
f99061866c Upgrade SMO to 150 preview (#701)
* Switch to the unified SMO NuGet so all binaries are strong named and signed.

* use one AssemblyLoader instance for all loads

* Revert "use one AssemblyLoader instance for all loads"

This reverts commit 48c59ffd5c57152de281c87acdbcad7ddf7ab760.

* Stop creating multiple AssemblyLoadContext objects during composition, per https://github.com/dotnet/coreclr/issues/19632

* restore high entropyva property

* Improve the comment

* Update SMO to 150 and fix scripting for objects with a single quote in their name.

* restore newtonsoft reference
2018-10-03 18:33:40 -04:00
AlexFsmn
41d0ef1814 Fixed correct value types when saving columns to a json file (#691) 2018-09-25 14:24:39 -07:00
ranasaria
09652cccd1 Enhanced Logging for sqltoolsservice (#695)
This change modifies the logging framework within sqltoolservice.
Moves away from custom Logger object to start using .Net tracing framework. It supports for the static Trace and TraceSource way of logging. For all new code it is recommend that we log the log messages using the existing static Logger class, while the code changes will continue to route the older Trace.Write* calls from the process to same log listeners (and thus the log targets) as used by the Logger class. Thus tracing in SMO code that uses Trace.Write* methods gets routed to the same file as the messages from rest of SQLTools Service code.
Make changes to start using .Net Frameworks codebase for all logging to unify our logging story.
Allows parameter to set tracingLevel filters that controls what kinds of message make it to the log file.
Allows a parameter to set a specific log file name so if these gets set by external code (the UI code using the tools service for example) then the external code is aware of the current log file in use.
Adding unittests to test out the existing and improved logging capabilities.


Sequences of checkins in development branch:
* Saving v1 of logging to prepare for code review. Minor cleanup and some end to end testing still remains
* Removing local launchSettings.json files
* added support for lazy listener to sqltoolsloglistener and removed incorrect changes to comments across files in previous checkin
* Converting time to local time when writing entries to the log
* move the hosting.v2 to new .net based logging code
* removing *.dgml files and addding them to .gitignore
* fixing typo of defaultTraceSource
* Addressing pull request feedback
* Adding a test to verify logging from SMO codebase
* propogating changes to v1 sqltools.hosting commandoptions.cs to the v2 version
* Fixing comments on start and stop callstack methods and whitespaces
* Commenting a test that got uncommented by mistake
* addding .gitattributes file as .sql file was observed to be misconstrued as a binary file
2018-09-24 23:55:59 -07:00
Mustafa Sadedil
98018c5292 Save as XML feature added (#684)
Similar approach used like Save as JSON or Save as CSV.
2018-09-10 12:11:51 -07:00
Karl Burtram
066be2f46f Revert "Switch to the unified SMO NuGet" (#686)
* Revert "fixed perf tests and added more scenarios (#683)"

This reverts commit aa2b30f486.

* Revert "Switch to the unified SMO NuGet so all binaries are strong named and signed. (#682)"

This reverts commit 69961992bb.
2018-09-04 11:01:44 -07:00
David Shiflet
69961992bb Switch to the unified SMO NuGet so all binaries are strong named and signed. (#682) 2018-08-20 08:27:52 -04:00