Commit Graph

99 Commits

Author SHA1 Message Date
Benjamin Russell
97a106c575 Removing a lot of redundant async/await wrappers (#1486)
* Removing a lot of redundant async/await wrappers

* Removing kusto changes
2022-06-05 08:26:21 -07:00
Charles Gagnon
048988e5d3 Add OE verbose logging (#1484)
* Add OE verbose logging

* verbose
2022-05-06 22:47:42 -07:00
Karl Burtram
853335df72 Revert "graph type logic for node sub type (#1440)" (#1468)
This reverts commit 553b9af36e.
2022-04-21 11:46:55 -07:00
Aditya Bist
553b9af36e graph type logic for node sub type (#1440) 2022-03-22 21:43:43 -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
Justin M
0c95a511d0 Fixed Azure Pipeline build warnings (#1254)
* Fixed Azure Pipeline build warnings

* Removed variable declaration in SmoScriptableOperationWithFullDbAccess catch block.
2021-10-04 13:30:43 -07:00
Karl Burtram
5d5debbad6 Enable scripting for subobjects such as triggers (#1237)
* WIP 1

* Cleanups

* Change how schema is appended in to urn

* Add comment and fix incorrect condition

* Add parent type name to support Views, etc.
2021-08-26 13:06:15 -07:00
Karl Burtram
63aa6758e8 Fix OE with dbpool connection (#1197)
* Fix OE with dbpool connection

* Remove extra whitespace

* Remove hard-coded number
2021-05-05 14:24:45 -07:00
BranislavGrbicMDCS
4ce9416219 removing server roles for sql od (#1107) 2020-10-30 08:15:29 -07:00
BranislavGrbicMDCS
3e98a2f17b [brgrbic] SqlOD changes for cloud Server Type and minor bug fixes (#1092)
* The ServerType of SQL OD in SMO is being changed to cloud. This is a minimal set of changes needed in sqltoolservice in order to keep everything working within ADS.

* SMO version update
2020-10-23 18:48:33 +02:00
Justin M
14f5a3e0f1 3278 Kusto Unit Test Refactor (#1053)
* 3278 Moved functions related to Metadata from DataSourceFactory to MetadataFactory.cs

* 3278 Refactored DataSourceFactory to not be static. Added IDataSourceFactory interface.

* 3278 Refactored IKustoIntellisenseHelper.cs to not be static. Added IKustoIntellisenseHelper.cs interface.

* 3278 Removed unused functions from Scripter and deleted ScripterCore.cs because it was unused. Refactored Scripter.cs methods to not be static and created IScripter.cs

* 3278 Refactored datsasourceConnectionFactory in ConnectionService to use MEF through the InitializeService function

* 3278 Refactored IAutoCompleteHelper to not be static and added IAutoCompleteHelper interface.

* 3278 Removed unused classes DatabaseFullAccessException and FeatureWithFullDbAccess. Refactored ObjectExplorerService to use ImportingConstructor attribute. Removed commented out in KustoResultsReader. Removed unused functions from DatabaseLocksManager. Removed unused IDataSourceConnectionFactory from ConnectionService

* 3278 Moved SqlConnectionOpener class to new file. Added new interfaces IConnectedBindingQueue.cs and ISqlConnectionOpener.cs Added sqlConnectionOpener to dependency in ConnectedBindingQueue.

* 3278 Removed needsMetadata param from ConnectedBindingQueue. Added param to AddConnectionContext where it's used

* 3278 Refactored ConnectedBindingQueue to use MEF. Refactored usages to run against interface.

* 3278 Corrected ServiceHost namespace. Removed unused dependency to sqlToolsContext in LanguageService. Updated dependency in MetadataService and LanguageService to IProtocolEndpoint instead of ServiceHost

* 3278 Added back NextResult function and summary to KustoResultsReader. Renamed instance to _instance in ConnectionService and DatabaseLocksManager to stay consistent. Changed OpenDataSourceConnection to private in ConnectionService

* 3278 Converted helper methods back to static and removed backing interfaces

* 3278 Reverted AdminService > InitializeService to use ServiceHost as param
2020-08-24 13:18:00 -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
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
BranislavGrbicMDCS
22905c9c13 Hiding programmability folder for sqlOD (#883) 2019-10-25 17:33:00 +02: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
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
David Shiflet
4f928133e1 fall back to master when connected to secondary (#854)
* fall back to master when connected to secondary

* use var per feedback
2019-08-22 12:16:28 -07:00
Charles Gagnon
ec09ad21d2 Revert "Default to Server level context for all OE nodes (#829)" (#838)
This reverts commit a4b6c300ac.

(cherry picked from commit 7512a2bbe3154e4dd4b63927fcba52db78424994)
2019-07-29 16:55:37 -07:00
Charles Gagnon
a4b6c300ac Default to Server level context for all OE nodes (#829) 2019-06-27 17:50:35 +00:00
Charles Gagnon
8ba59859dc Correct typo in NodeType for SecurityPolicy (#796) 2019-04-08 07:39:31 -07:00
Yurong He
adc13cff82 Unified connection support (#765)
* Added the query to get big data cluster endpoints
Added bigDataClusterEndpoints to ObjectExplorerSession
Added bigDataClusterEndpoints to ServerInfo
Fixes some tests.

* Removed bigDataClusterEndpoints from session

* Since server property to get IsBigDataCluster is not implemented yet, use query of sys.asseblies instead to unblock us. Need to use server property when it is available
Add options to ServerInfo, so no need to change the contract in the further when adding new properties. Will move the existing properties to option later

* Undo changes not needed

* Resolved PR comments.

* Fixed node is null exception when can't find NodePath.

* Added comments

* Removed not used using

* Catch sqlException for the reader of BDC endpoints and set empty list to the option.

* Added comments for returning empty nodes.
2019-01-24 20:06:35 -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
Karl Burtram
3c915a92f6 Send a Object Explorer session disconnect message on socket exceptions (#739)
* WIP

* WIP 2

* Send disconnect message o binding exception

* Add a try catch around the binding queue error handler
2018-11-16 12:07:05 -08: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
Matt Irvine
8fe3d06068 Load properties used for OE node status by group instead of individually (#706) 2018-10-11 10:41:48 -07:00
Matt Irvine
acf7634425 Clear OE node error message when populating children (#705) 2018-10-08 11:09:17 -07:00
Matt Irvine
f45155aa4a Fix OE and Binding Queue reliability bugs (#702) 2018-10-05 14:14:36 -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
AlexFsmn
d8c088e0f6 Fixed correct max column labels for varbinary, nvarchar and varchar (#692) 2018-09-18 14:34:00 -07:00
Leila Lali
7322854c7b fixed the bug with view triggers in object explorer (#639) 2018-06-18 11:36:24 -07:00
Alex Tercete
bd11fd2129 Override GetNodePathName for custom-named table nodes (#601) 2018-04-10 13:30:22 -07:00
Matt Irvine
167948256c Use object names instead of labels in node paths (#600) 2018-04-06 14:36:47 -07:00
Matt Irvine
92456d50aa Expand nodes for findNodes instead of refreshing (#599) 2018-04-06 09:18:37 -07:00
Matt Irvine
3937ebef38 Include inline functions as table-valued functions in Object Explorer (#594) 2018-03-21 15:48:20 -07:00
Matt Irvine
365fe2282e Support Object Explorer FindNodes request (#589) 2018-03-15 10:47:52 -07:00
Matt Irvine
0eaf60c93a Detect system connection for OE if database display name is blank (#583) 2018-02-12 11:13:03 -08:00
Leila Lali
c40c740a73 fixed the bug with loading default constraints in oe (#582)
* fixed the bug with loading default constraints in oe
2018-02-09 08:51:41 -08:00
Matt Irvine
efd38be0be Use requested database when determining if a connection is a system db connection (#580) 2018-02-06 15:19:18 -08:00
Leila Lali
4d4e0b1194 The filter for the function is valid for all sql version except for DW (#574) 2018-01-08 09:34:44 -08:00
Leila Lali
0ccc01eda9 fixed a bug with OE connection changed the db name and blocked restore (#570) 2018-01-02 10:57:37 -08:00
Matt Irvine
1c2b44fe74 Mark database OE nodes as leaf nodes if they are unavailable (#569) 2017-12-13 10:58:23 -08:00
Leila Lali
dedca05721 fixed the keys filter to support 2012 and 2014 also (#565)
* fixed the keys filter to support 2 all sql versions also
2017-12-11 10:34:26 -08:00
Kevin Cunnane
392325036e Fix uplevel SQL Server support and differentiate External and FileTable types in object explorer list (#567)
* Differentiate External and FileTable types in object explorer list
- Add (External) and (File Table) to the labels
- Pre-fetch these properties to avoid perf hit

Note on testing: These are both quite hard to initialize, so adding tests to the integration tests would require always having a server with Polybase enabled / FileTable enabled. Given this I feel it should be OK to use manual testing. Long term, we should have unit-level tests that cover the functionality or figure out how to have a perfect pre-configured server and a set of tests to run the breadth of this logic against it.

* Fix handling of vNext servers to default to latest known version
- Default uplevel / unknown versions to the latest version
- In the IsValidFor check also just see if the server version registers as "All" since this is the default for unknown servers. This is a backup handler, the 1st fix is the primary one
2017-12-08 17:52:49 -08:00
Leila Lali
1ec297efe2 improving OE tables expand (#555)
* improving OE tables expand for dw database
2017-12-01 14:49:42 -08:00
Leila Lali
864c4f60cd Adding Indexes of all types to OE indexes folder (#557) 2017-12-01 13:40:21 -08:00
Leila Lali
7a3baf6620 loading database status for all databases in the server to fix the perf issue (#547) 2017-11-15 15:46:53 -08:00