Commit Graph

46 Commits

Author SHA1 Message Date
Karl Burtram
4184eae8a1 Update docs (#200)
This is a documentation-only update so automerging.  Please review the commit if there are any follow-ups requested.

* Update .gitignore for docfx genertated files

* Update documenation (part 1)

* Update docs and add some samples

* More doc updates
2016-12-20 15:52:46 -08:00
Karl Burtram
5c2e6b74cf Catch exceptions raised sending telemetry events (#182) 2016-12-12 15:50:08 -08:00
Leila Lali
7d37431c0d fixed connection service tests 2016-12-08 14:12:34 -08:00
Leila Lali
0b295e78c2 adding a new event for when definition is requested (#167)
* sending telemetry events for intellisense usage
2016-12-08 14:05:42 -08:00
Karl Burtram
84eb164d87 Remove enabling MARS again. This merged down from master (#162) 2016-11-28 13:00:41 -08:00
Karl Burtram
39b79ae05b Merge branch 'master' into dev 2016-11-28 09:58:32 -08:00
Benjamin Russell
d9efb95386 Progressive Results Part 2: Result Completion Event (#134)
The main change in this pull request is to add a new event that will be fired upon completion of a resultset but before the completion of a batch. This event will only fire if a resultset is available and generated.

Changes:
* ConnectionService - Slight changes to enable mocking, cleanup 
* Batch - Moving summary generation into ResultSet class, adding generation of ordinals for resultset and locking of result set list (which needs further refinement, but would be outside scope of this change)
* Adding new event and associated parameters for completion of a resultset. Params return the resultset summary
* Adding logic for assigning the event a handler in the query execution service
* Adding unit tests for testing the new event /making sure the existing tests work
* Refactoring some private properties into member variables

* Refactor to remove SectionData class in favor of BufferRange

* Adding callback for batch completion that will let the extension know that a batch has completed execution

* Refactoring to make progressive results work as per async query execution

* Allowing retrieval of batch results while query is in progress

* reverting global.json, whoops

* Adding a few missing comments, and fixing a couple code style bugs

* Using SelectionData everywhere again

* One more missing comment

* Adding new notification type for result set completion

* Plumbing event for result set completion

* Unit tests for result set events

This includes a fairly substantial change to create a mock of the
ConnectionService and to create separate memorystream storage arrays. It
preserves more correct behavior with a integration test, fixes an issue
where the test db reader will return n-1 rows because the Reliable
Connection Helper steals a record.

* Adding locking to ResultSets for thread safety

* Adding/fixing unit tests

* Adding batch ID to result set summary
2016-11-22 17:37:27 -08:00
Benjamin Russell
ec94d986a8 Unit Test Cleanup (#141)
This is a fairly large set of changes to the unit tests that help isolate the effectiveness of the unit tests.

* Unit tests for query execution have been split into separate files for different classes.
* Unit tests have been added for the ResultSet class which previously did not have tests
* The InMemoryStreamWrapper has been improved to share memory, creating a simulated filesystem
* Creating a mock ConnectionService to decrease noisy exceptions and prevent "row stealing". Unfortunately this lowers code coverage. However, since the tests that touched the connection service were not really testing it, this helps keep us honest. But it will require adding more unit tests for connection service.
* Standardizing the await mechanism for query execution
* Cleaning up the mechanism for getting WorkspaceService mocks and mock FileStreamFactories

* Refactor the query execution tests into their own files

* Removing tests from ExecuteTests.cs that were moved to separate files

* Adding tests for ResultSet class

* Adding test for the FOR XML/JSON component of the resultset class

* Setting up shared storage between file stream readers/writers

* Standardizing on Workspace mocking, awaiting execution completion

* Adding comment for ResultSet class
2016-11-10 11:42:31 -08:00
Karl Burtram
cd5abad0f2 Merge branch 'release/ctp10' 2016-11-06 20:45:48 -08:00
Mitchell Sternke
b62f67607f Redefined ordering for list databases to be by name (#103) 2016-10-19 10:57:20 -07:00
Mitchell Sternke
a3335708c6 Feature/reliable connection tests (#102)
* Ported ReliableConnectionTests from DacFx and added a few more tests

* Fix style

* Created integration tests configuration and fixed minor test issue
2016-10-18 12:19:16 -07:00
Mitchell Sternke
a2f2dd7b5e Disabled MARS by default (#88)
* Disabled MARS by default

* Addressing feedback

* Added check for unhandled ObjectDisposedException
2016-10-10 17:15:26 -07:00
Karl Burtram
52b5f222db Merge dev to master for 0.0.7 release (#86)
* Disable failing test while investigating

* Made connection errors more user-friendly (#57)

* Bug/negativeOneRowsAffected strings file fix (#61)

* Adding changes to sr.strings files

* Fixing bug by changing valid filename check to fail on whitespace (#55)

Fixing a bug from the unit tests on OSX/Unix where attempting to create a file with a name that's all whitespace succeeds when it should fail. This was passing in Windows because File.Open throws an ArgumentException when an all whitespace name is provided. In Unix systems, File.Open does not throw, causing the test to fail.

Solution is to check for whitespace in the sanity check.

* Format Cell Values (#62)

* WIP for ability to localize cell values

* Changing how DateTimeOffsets are stored, getting unit tests going

* Reworking BufferFileStreamWriter to use dictionary approach

* Plumbing the DbCellValue type the rest of the way through

* Removing unused components to simplify contract

* Cleanup and making sure byte[] appears in parity with SSMS

* CR comments, small tweaks for optimizing LINQ

* Feature/batch line info (#56)

* inital pipe of line numbers and getting text from workspace services

* tests compile

* Fixed bug regarding tests using connections on mac

* updated tests

* fixed workspace service and fixed tests

* integrated feedback

* Remove deleted file with whitespace name

* Feature/autocomp options (#63)

* Enable IntelliSense settings

* Fix up some bugs in the IntelliSense settings.

* Code cleans for PR

* Fix a couple exceptions that are breaks query execute and intellisense.

* Add useLowerCase flag and settings tests

* Remove task.wait from test to avoid break on build machine. (#67)

This is to fix test breaks so I'll merge now.  Please let me know if there are comments on this commit.

* Do not use ReliableCommand in the query execution service (#66)

* Do not use ReliableCommand in the query execution service.

* Fixing the logic to remove InfoMessage handlers from ReliableSqlConnection

* Adding test to query UDT

* Bump SMO to 140.1.6 to pick up perf fixes (#69)

* Enable Quick Info hover tooltips (#65)

Pushing to include in tomorrow's partner release build.  Please send me any feedback and I'll address in the next Intellisense PR.

* Added grouping between system/user dbs when listing (#70)

* Feature/timestamp messages (#68)

* added support for timestamps

* fixed tests

* Moved message class to own file; added 'z' to end of date strings

* added default time constructor

* removed unnecessary z

* added time string format info in comment

* changed from utc time to using local time

* Feature/save selection (#64)

* Save selection

* Add tests

* Change filename in test

* Code cleanup

* Refactor handler

* Code cleanup

* Modify tests to have query selection

* Change variable declaration

* Bump SMO to 14.0.7 to pick Batchparser updates (#72)

...bumping versions.  No review needed.

* Lingering File Handles (#71)

Fixing a bug where in various situations, the files used for temporary storage of query results would be leftover. In particular, the following changes were made:
* When the dispose query request is submitted, the corresponding query is now disposed in addition from being removed from the list of active queries
* When a query is cancelled, it is disposed after it is cancelled
* If a query already exists for a given ownerURI, the existing query is disposed before creating a new query
* All queries are disposed when the query execution service is disposed (ie, at shutdown of the service)

A unit test to verify the action of the dispose method for a ResultSet was added.

* Ensuring queries are disposed

Adding logic to dispose any queries when:
* URI that already has a query executes another query
* A request to dispose a query is submitted
* A request to cancel a query is submitted

* Small tweaks for cleanup of query execution service

* Add IntelliSense binding queue (#73)

* Initial code for binding queue

* Fix-up some of the timeout wait code

* Add some initial test code

* Add missing test file

* Update the binding queue tests

* Add more test coverage and refactor a bit.  Disable reliabile connection until we can fix it..it's holding an open data reader connection.

* A few more test updates

* Initial integrate queue with language service.

* Hook up the connected binding queue into al binding calls.

* Cleanup comments and remove dead code

* More missing comments

* Fix build break.  Reenable ReliabileConnection.

* Revert all changes to SqlConnectionFactory

* Resolve merge conflicts

* Cleanup some more of the timeouts and sync code

* Address code review feedback

* Address more code review feedback

* Feature/connect cancel (#74)

* Implemented connection cancellation

* Made connect requests return immediately and created a separate connection complete notification

* Fix spelling

* Fix sorting

* Add separate lock for cancellation source map

* Fix an issue with queue deadlocks causing test failures (#77)

* Fixed issue where connecting could take very long and cancellation would not work (#78)

* Fixed issue where connecting could take very long and cancellation would not work

* Addressing feedback

* Remove warning suppression

* Adding unlimited timeout for query execution (#76)

Adding explicitly setting the timeout for command execution to unlimited. We can change this to be user configurable at a later time

* Support 'for XML and for JSON' queries (#75)

* Set isXMl and isJson for 'for xml/json' resultSets

* Change string comparison

* Modify if-else

* VSTS 8499785. Close SqlToolsService after VS Code exits. (#80)

VSTS 8499785. Close SqlToolsService after VS Code exits.

* Remove extra level of tasks in binding queue (#79)

* Remove extra layer of tasks in binding queue

* Change order of assigning result to avoid race condition

* Add timeout log for the metadata lock event

* Fix test cases
2016-10-08 19:18:26 +00:00
Mitchell Sternke
926cfbf3bc Fixed issue where connecting could take very long and cancellation would not work (#78)
* Fixed issue where connecting could take very long and cancellation would not work

* Addressing feedback

* Remove warning suppression
2016-10-06 10:15:59 -07:00
Mitchell Sternke
8408bc6dff Feature/connect cancel (#74)
* Implemented connection cancellation

* Made connect requests return immediately and created a separate connection complete notification

* Fix spelling

* Fix sorting

* Add separate lock for cancellation source map
2016-10-04 15:45:52 -07:00
Karl Burtram
62525b9c98 Add IntelliSense binding queue (#73)
* Initial code for binding queue

* Fix-up some of the timeout wait code

* Add some initial test code

* Add missing test file

* Update the binding queue tests

* Add more test coverage and refactor a bit.  Disable reliabile connection until we can fix it..it's holding an open data reader connection.

* A few more test updates

* Initial integrate queue with language service.

* Hook up the connected binding queue into al binding calls.

* Cleanup comments and remove dead code

* More missing comments

* Fix build break.  Reenable ReliabileConnection.

* Revert all changes to SqlConnectionFactory

* Resolve merge conflicts

* Cleanup some more of the timeouts and sync code

* Address code review feedback

* Address more code review feedback
2016-10-04 14:55:59 -07:00
Mitchell Sternke
3f77e14347 Added grouping between system/user dbs when listing (#70) 2016-09-29 11:57:28 -07:00
Karl Burtram
806220c4b5 Feature/autocomp options (#63)
* Enable IntelliSense settings

* Fix up some bugs in the IntelliSense settings.

* Code cleans for PR

* Fix a couple exceptions that are breaks query execute and intellisense.

* Add useLowerCase flag and settings tests
2016-09-25 12:53:28 -07:00
Anthony Dresser
f22c8a7283 Feature/batch line info (#56)
* inital pipe of line numbers and getting text from workspace services

* tests compile

* Fixed bug regarding tests using connections on mac

* updated tests

* fixed workspace service and fixed tests

* integrated feedback
2016-09-22 17:58:45 -07:00
Mitchell Sternke
803a19d716 Made connection errors more user-friendly (#57) 2016-09-21 11:59:03 -07:00
Karl Burtram
e74a392ca9 Improve autocomplete locking 2016-09-18 01:54:32 -07:00
Benjamin Russell
41198e9357 Adding sr.strings file and removing hard-coded strings (#52)
* Strings sweep for connection service

* String sweep for credentials service

* String sweep for hosting

* String sweep for query execution service

* String sweep for Workspace service

* Renaming utility namespace to match standards

Renaming Microsoft.SqlTools.EditorServices.Utility to
Microsoft.SqlTools.ServiceLayer.Utility to match the naming changes done a
while back. Also renaming them on the files that use them

* Namespace change on reliable connection

* Adding the new resx and designer files

* Final bug fixes for srgen

Fixing flakey moq package name

* Removing todo as per @kevcunnane

* Adding using statements as per @llali's comment

* Fixing issues from broken unit tests

Note: This feature contains changes that will break the contract for
saving as CSV and JSON. On success, null is returned as a message instead
of "Success". Changes will be made to the vscode component to handle this
change.
2016-09-16 16:18:25 -07:00
Mitchell Sternke
f2a5654a20 Feature/reliable connection (#44)
* Initial commit of reliable connection port

* Made ReliableSqlConnection inherit from DbConnection instead of IDbConnection

* Cleanup

* Fixed autocomplete service to use reliable connection

* Fix copyright headers

* Renamed ConnectResponse.Server to ServerInfo

* Removed unused using

* Addressing code review feedback
2016-09-13 18:10:26 -07:00
Kevin Cunnane
14b6348b20 Connect should return actual DB Name (#42)
- On Connecting to a server with no DB specified, we will actually get a connection to Master or some default DB.
- This DB should be used when notifying others of a new connection, and when returning information to the caller so that the correct name can be displayed in the UI.
- Added basic unit tests to cover this scenario
2016-09-12 11:32:02 -07:00
Kevin Cunnane
8ca88992be Credentials store API (#38)
* CredentialService initial impl with Win32 support

- Basic CredentialService APIs for Save, Read, Delete
- E2E unit tests for Credential Service
- Win32 implementation with unit tests

* Save Password support on Mac v1

- Basic keychain support on Mac using Interop with the KeyChain APIs
- All but 1 unit test passing. This will pass once API is changed, but checking this in with the existing API so that if we decide to alter behavior, we have a reference point.

* Remove Username from Credentials API

- Removed Username option from Credentials as this caused conflicting behavior on Mac vs Windows

* Cleanup Using Statements and add Copyright

* Linux CredentialStore Prototype

* Linux credential store support

- Full support for Linux credential store with tests

* Plumbed CredentialService into Program init

* Addressing Pull Request comments
2016-09-06 18:12:39 -07:00
Mitchell Sternke
76e7ea041c Merge pull request #37 from Microsoft/bug/integratedSecurityDefault
Removed cases where we set integrated security by default
2016-09-06 17:14:23 -07:00
Mitchell Sternke
f5e40d7944 Addressing feedback 2016-09-06 17:10:55 -07:00
Mitchell Sternke
4b35d77214 Removed cases where we set integrated security by default to fix linux issue 2016-09-02 17:53:02 -07:00
Mitchell Sternke
f6f59f3453 Merge branch 'dev' into feature/connectionChanged 2016-09-02 16:58:59 -07:00
Mitchell Sternke
93bf2af8bb Fire connection changed event when USE statements are executed 2016-09-02 16:43:32 -07:00
Karl Burtram
baebaeb0c4 Merge pull request #34 from Microsoft/feature/testSmo
Enable SMO-based autocomplete
2016-09-02 12:02:31 -07:00
Karl Burtram
1b7e27fe76 Get SqlConnection from casting DbConnection 2016-09-02 11:41:41 -07:00
Karl Burtram
e5367416b8 Merge branch 'dev' into feature/testSmo 2016-09-01 09:59:20 -07:00
Mitchell Sternke
a30ff33187 Addressing code review feedback 2016-08-31 16:04:04 -07:00
Mitchell Sternke
3fe6e330fe Added support for most sql connection string properties 2016-08-30 17:31:34 -07:00
Mitchell Sternke
015bb26d9a Merge branch 'dev' into feature/listDatabases 2016-08-25 16:52:35 -07:00
Karl Burtram
89ca0c1fde Inital SMO autocomplete commit 2016-08-24 23:03:43 -07:00
Mitchell Sternke
7d3d593a80 Added request to list databases on the server for the current connection 2016-08-24 16:03:08 -07:00
Mitchell Sternke
14399ede65 Added inner exceptions on connection failure and fixed a param validation bug 2016-08-22 16:26:02 -07:00
Mitchell Sternke
a6cc14d31f Cleaned up connection management code 2016-08-16 13:48:36 -07:00
Mitchell Sternke
f3231fba56 Addressing PR 14 feedback 2016-08-09 10:17:29 -07:00
Mitchell Sternke
5c03ba336d Added disconnect and connect when already connected service code 2016-08-05 17:46:16 -07:00
Mitchell Sternke
8fba793a46 Incremental checkin of connection work 2016-08-05 10:56:51 -07:00
Kevin Cunnane
402e25f77d Per editor Connect support v0.1
- Basic plumbing to support connections for a URI rather than global connections. Typical use case is editor requests to connect, but this isn't the only possible use
- Tests pass but need updating to cover new functionality, and re-enable AutoCompleteService test once there is a ServiceDiscovery component that registers and returns services. This is necessary as .Instance won't allow for dependency injection and proper testing.
2016-08-04 14:01:17 -07:00
Benjamin Russell
d191b0483c Small bugfix after the previous merge
My mistake, didn't pay enough attention when performing the refactoring as
requested in the last code review.
2016-08-03 15:41:11 -07:00
Benjamin Russell
13fd97ef90 Fixing issues as per suggestions from @kevcunnane 2016-08-03 14:51:17 -07:00