Commit Graph

158 Commits

Author SHA1 Message Date
Sebastian Pfliegel
84f62a3e85 Added more options to SaveResultsAsCsvRequestParams (#669)
Fixes Microsoft/sqlopsstudio#203
Options:
LineSeperator
TextIdentifier
Encoding
2018-08-01 15:15:11 -04:00
David Shiflet
0b4228a7d9 Update Sql Management Objects to latest version (#666) 2018-07-27 17:25:16 -04:00
Matt Irvine
c7ac3aeaae Fix bug where strings that looked like dates were transformed when reading messages (#663)
* Do not try to parse dates when reading messages

* Add test
2018-07-24 12:37:08 -04:00
Chirag Rupani
77a08b4bdd Added support for specifying delimiter while exporting query results as CSV (#653) 2018-07-12 10:39:23 -07:00
Madeline MacDonald
838a7e4fab Profiler notifications (#640)
* Initial changes for adding lost event notifications

* Handling polling errors by notifying listeners

* Restructuring lost events & testing

* Minor fixes to tests

* Add back in filtering

* Changing how lost events are found

* Cleaning up tests
2018-06-18 17:43:22 -07:00
Madeline MacDonald
f53e532225 Adding pausing functionality for the profiler (#634)
* Dropping profiler session on stop request

* Changes to IXEventSession to simplify dropping sessions

* Stop sessions instead of dropping, disable flaky tests

* Initial framework for profiler pause requests

* Restructuring profiler session monitoring

* Fixes to session monitor

* Testing for pause functionality

* Fixing comments from PR

* Changes to testing

* Commenting out flaky test

* Deleting leftover testing code
2018-06-13 17:55:01 -07:00
Karl Burtram
8dda34c95a Add Agent Job and Job Step request handlers (#635)
* Stage changes

* Fix update job request handler

* WIP

* Additional agent handler updates

* Setup agent job step create test

* Fix Step update handler
2018-06-13 10:02:25 -07:00
Madeline MacDonald
35b19320d4 Stopping sessions when handling stop requests (#627)
* Dropping profiler session on stop request

* Changes to IXEventSession to simplify dropping sessions

* Stop sessions instead of dropping, disable flaky tests
2018-06-05 13:48:55 -07:00
Madeline MacDonald
f5efe18e1b Updating profiler old event filtering and unit tests (#624) 2018-05-29 17:08:59 -07:00
Alan Ren
45ca7fc071 SMO Refresh with SSMS 17.7 binaries (#616) 2018-05-08 13:35:58 -07:00
Leila Lali
5baa3bc18a fixed the bug with editing more than one row should fail (#613)
* fixed the bug with editing more than one row should fail
2018-05-02 13:51:07 -07:00
Cory Rivera
7415c529f3 Add support for using generic SQL queries to filter EditData rows. (#605) 2018-05-02 10:13:47 -07:00
Kevin Cunnane
e02592460b Reduce unit test time by 1 minute (#607)
ObjectExplorerTests were adding 1 minute to total test time due to
unnecessarily trying and failing to connect to a non-existent server.
Mocking out this call saves 1minute, reducing test time in half
2018-04-30 22:15:38 -07:00
Cory Rivera
dca33d768d Bump System.Data.SqlClient package version used in SqlTools projects. (#608) 2018-04-30 16:57:07 -07:00
Karl Burtram
e73a8ddca6 Update projects for netcoreapp2.1 SDK (#603)
* Update projects for netcoreapp2.1 SDK

* Fix whitespace

* Fix issue in Nuget config file
2018-04-23 17:06:52 -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
d19db1b4fe Handle errors during execution as info messages instead of exceptions (#596) 2018-04-03 08:47:44 -07:00
Matt Irvine
3937ebef38 Include inline functions as table-valued functions in Object Explorer (#594) 2018-03-21 15:48:20 -07:00
Kevin Cunnane
30c4b97f2a Fix batch results with GO N (#587)
- Fixes https://github.com/Microsoft/vscode-mssql/issues/1066
2018-03-21 13:41:58 -07:00
Matt Irvine
aaa3513db2 Unexpected request handler errors no longer crash SQL Tools Service (#591)
* Handler errors no longer crash service

* Disable additional flaky test
2018-03-15 14:14:09 -07:00
Matt Irvine
365fe2282e Support Object Explorer FindNodes request (#589) 2018-03-15 10:47:52 -07:00
Karl Burtram
d36efb578c Disabling test that has failed in the CI builds on-and-off the past few weeks (#588) 2018-03-13 10:11:14 -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
Karl Burtram
0121531bf6 Bugs fixes so XEvent profiler isn't broken (#577)
* Fix a few issues with profiler method handlers

* Filter out profiler polling events

* Add a unit test for profiler events

* Add method comment headers
2018-01-17 18:21:40 -08:00
Benjamin Russell
b7cffa3194 Edit Data: Fix to work with tables with triggers (#576)
* Moving logic for adding default values to new rows

* Fixing implementation of script generation to handle default values all around

* Unit tests!

* WIP

* Reworking row create script/command generation to work more cleanly and work on triggered tables

* Addressing some bugs with the create row implementation

* Implementing the trigger table fix for row updates
Some small improvements to the create/update tests.
2018-01-10 14:02:07 -08:00
Leila Lali
d20215cb19 added script as alter (#564)
* added script as alter
2017-12-07 12:49:38 -08:00
Matt Irvine
90611034cf Disable flaky test (#559) 2017-12-06 16:10:41 -08:00
Benjamin Russell
64133d929e Edit Data: Better Formatting Errors (#562)
* Refactoring sql script formatting helpers into To and From helpers

* Updates to make error messages for formatting errors more useful

* Fixing dumb breaks in unit tests

* Addressing comments from PR

* Updates to the SR files...
2017-12-05 17:00:13 -08:00
Benjamin Russell
2190039df2 Edit Data: Create Row with Nullable Columns (#553)
* WIP

* All the new RowCreate tests are working

* Fixing a couple bugs with the row delete and row update tests

* Regenerating localization files

* Fixing multiple iteration in tests
2017-11-28 14:59:48 -08:00
Kevin Cunnane
b8e46ce65f Support GO N syntax to execute multiple times (#551)
* Support `GO N` syntax to execute multiple times
- Plumbed through the batch execution count from the parser and used in the batch execution code path
- Functionality matches SSMS:
  - Outputs loop start/end messages that match SSMS if you're doing multi-batch execution
  - Outputs an "ignoring failure" error if an error happens during a batch
- Added tests for this
- Manually verified end to end also

* Fixing test error
2017-11-22 11:33:19 -08:00
Kevin Cunnane
42ee96f99f Fix Ops Studio issue 97 where query connection is dropped (#549)
- Fixes https://github.com/Microsoft/sqlopsstudio/issues/97.
- This should fix the bulk of the issues reported by users since it's the 1st use of this connection in the query code path.
- Implemented the fix in the connection service. This will always open a connection when calling `GetOrOpenConnection`. I cannot see a reason why the connection returned from this should ever be closed.
- resolve issues in both this code path and the edit data code path since both use this method.
2017-11-21 14:46:20 -08:00
Benjamin Russell
d7080eb07e Edit Data: Fixing Defaults Behavior (#533)
* Moving logic for adding default values to new rows

* Fixing implementation of script generation to handle default values all around

* Unit tests!

* Addressing PR comments
2017-11-20 14:14:41 -08:00
Saurabh Singh
4c329921c7 Update smo (#530)
* update the version in CSPROJ

* Add the updated SMO package
2017-10-26 10:55:04 -07:00
Kate Shin
cc9beed835 Fix file browser cancel/connetion issues (#528)
* clean bindingqueue after cancel

* fileborwser fixes

* code cleanup

* re-initialize filetree whenever filter is changed

* fix test issues

* address pr comments
2017-10-26 10:54:22 -07:00
Anthony Dresser
399b03cbd1 Add force change database logic (#519)
* add logic to close connections if changing fails

* added logic to close connections and reopen that fail to change (azure)

* expose connection map in connection info, change while to foreach

* removed unneeded code

* reworked logic to not depend on thrown errors

* added tests
2017-10-25 10:54:17 -07:00
Benjamin Russell
e9bc97e290 Edit Data: Better errors for possible truncation (#514)
* Fix to make sql exceptions surface properly to user (with important notes!)

* Adding support for detecting column size issues when updating a cell

* Adding unit tests for the exception on read scenario
2017-10-21 11:08:40 -07:00
Aditya Bist
49f0221dc8 updated smo nuget package with latest bits (#508)
* updated smo nuget package with latest bits

* added new nupkg

* fixed peek definition test

* fixed batch parser wrapper tests
2017-10-19 18:02:47 -07:00
Benjamin Russell
639cd91fe2 Moving event flow validatior into test.common 2017-10-19 14:27:37 -07:00
Benjamin Russell
9600125186 File Browser: Adding async task exception handling (#504)
* Replacing Dictionary with ConcurrentDictionary since values are accessed in async contexts

* Adding new method to allow async tasks to be executed in the exception continuation

* Adding unit tests for the aforementioned

* Adding exception handling to async tasks in file browser service

* Updating query execution async handling to use the async version

* Removing unnecesary send result from continuewithonfaulted
2017-10-19 11:25:29 -07:00
Kevin Cunnane
4b66203dfc Fix tools service crash + improve server edition naming (#506)
* Fix https://github.com/Microsoft/vscode-mssql/issues/986 and add better server edition naming
- Fixed a number of issues related to the binding queue, specifically the fact that it didn't capture exceptions that occurred on the binding thread. This caused the thread to crash the service.
  - The root cause of the error was when you get a connection error during init of the SmoMetadataProvider which threw an exception. Because of this no Binder was created, and the code would null ref later during processing
  - Added logic to handle null ref issue and other related code
  - Added a unit test for the new error handling path, and supported still returning some value in this case
- Separately, have a fix for an issue where the edition is shown as "SQL Azure" for all Azure connections. Fixing to be "Azure SQL DB" for this case and handle when the database reports as DW or Stretch instead. This maps better to users concept of what the edition should be and avoids returning what is an outdated term.

* Messed up the test - fixing this by returning the expected return object
2017-10-19 10:42:26 -07:00
Benjamin Russell
705a89624a Query Execution: Better exception handling on unawaited async tasks (#502)
* WIP

* This code makes it work!

* Adding similar exception hanling behavior to saving result sets

* Adding unit tests for new extension methods
Auto-cleanup of proj file whitespace

* Implementing changes as per code review comments
2017-10-18 12:52:45 -07:00
Kevin Cunnane
0c7f559315 Improve error message handling (#497)
- Add special handling for token expired errors so they send with a clear flag that'll allow clients to take action on this case
- Send error message instead of callstack for all messages, and ensure all resource manager paths send back inner exceptions so users can understand the true root cause.
2017-10-13 17:48:25 -07:00
Kevin Cunnane
b416951414 Unit tests for Azure scenarios (#495)
* Test firewall rule handling is able to process through the service layer

* Additional tests for authentication and the resource wrapper code

* Positive test case for CreateFirewallRule

* Fixed copyright and usings
2017-10-12 17:23:34 -07:00
Kevin Cunnane
077ce4de1b Fix travis (#490)
* Also disabled flaky test and disable macOS build
2017-10-11 15:27:40 -07:00
Kevin Cunnane
7acc668c04 Create Firewall Rule support with a simple Resource Provider implementation
Implementation of the resource provider APIs in order to support Create Firewall Rule. Provides definition for a ResourceProvider and Authentication service. The ResourceProvider supports firewall rules for now, and since authentication is routed through that method it will call into the auth service to set up the current account to be used.

Additional notes:
- Fixed deserialization by adding an Accept header. This shouldn't be necessary, but for some reason the firewall rule defaults to XML without this
- Use generic server list and parse the ID to get the resource group, avoiding a large number of extra calls for each RG
- Errors now include error message from the API
2017-10-09 15:45:33 -07:00
Leila Lali
fecf56bce2 closing the default connections that are opned just for validating the connections. Added the feature to application name in the connection (#483) 2017-10-09 10:49:12 -07:00
Kate Shin
2c4f2cf6b8 Fix restore service to set target db same as source db (#479)
* fix restore service to change target db

* add overwriteTargetDb param

* update comment
2017-10-06 11:31:10 -07:00
Leila Lali
f09b9f4c30 Fixing the bug with connections on database make restore fail (#473)
* closing the connections that don't need to be open and keeping track of the connections that should stay open
2017-10-05 20:06:31 -07:00
Aditya Bist
7444939335 Task/script refactor (#478)
* scripting working with race conditions

* new service works with no race conditions

* use new scripting service and commented out tests

* refactored peek definition to use mssql-scripter

* fixed peek definition tests

* removed auto gen comment

* fixed peek definition highlighting bug

* made scripting async and fixed event handlers

* fixed tests (without cancel and plan notifs)

* removed dead code

* added nuget package

* CR comments + select script service implementation

* minor fixes and added test

* CR comments and script select

* added unit tests

* code review comments and cleanup

* fixed failing scripting tests

* fixed failing scripting tests

* fixed select script test

* code review comments
2017-10-05 12:19:08 -07:00