Commit Graph

227 Commits

Author SHA1 Message Date
Benjamin Russell
60edcc3057 Make query execution truly asynchronous (#83)
The two main changes in this pull request:
Launching query execution as an asynchronous task that performs a callback upon completion or failure of a query. (Which also sets us up for callbacks progressive results)
Moving away from using the Result of a query execution to return an error. Instead we'll use an error event to return an error
Additionally, some nice refactoring and cleaning up of the unit tests to take advantage of the cool RequestContext mock tooling by @kevcunnane

* Initial commit of refactor to run execution truely asynchronously

* Moving the storage of the task into Query class

Callbacks for completion of a query and failure of a query are setup as
events in the Query class. This actually sets us up for a very nice
framework for adding batch and resultset completion callbacks.

However, this also exposes a problem with cancelling queries and returning
errors -- we don't properly handle errors during execution of a query
(aside from DB errors).

* Wrapping things up in order to submit for code review

* Adding fixes as per comments
2016-10-11 10:51:52 -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
Mitchell Sternke
8511f5db43 Fixed issue where mac connections would not time out as expected (#81)
* Fixed issue where mac connections would not time out as expected

* Made check specific to OSX

* Added check for linux
2016-10-10 17:14:24 -07:00
Leila Lali
a3089978e1 Setting the rpath for System.Security.Cryptography.Native.dylib at bu… (#84)
* Setting the rpath for System.Security.Cryptography.Native.dylib at build time for mac
2016-10-10 08:47:35 -07:00
Karl Burtram
f32b0290bb 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 00:06:35 +00:00
sgreenmsft
03d7fd94c8 VSTS 8499785. Close SqlToolsService after VS Code exits. (#80)
VSTS 8499785. Close SqlToolsService after VS Code exits.
2016-10-07 16:30:54 -07:00
Sharon Ravindran
fea9bb43c5 Support 'for XML and for JSON' queries (#75)
* Set isXMl and isJson for 'for xml/json' resultSets

* Change string comparison

* Modify if-else
2016-10-06 11:35:29 -07:00
Benjamin Russell
46f0638283 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
2016-10-06 10:26:34 -07: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
Karl Burtram
c6a2568075 Fix an issue with queue deadlocks causing test failures (#77) 2016-10-05 20:35:57 -04: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
Benjamin Russell
1b8e9c1e86 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
2016-10-03 11:35:58 -07:00
Karl Burtram
f16d0104d0 Bump SMO to 14.0.7 to pick Batchparser updates (#72)
...bumping versions.  No review needed.
2016-09-30 15:50:38 -07:00
Sharon Ravindran
20b64eadbf 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
2016-09-30 13:48:37 -07:00
Anthony Dresser
d451447ebc 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
2016-09-30 11:46:32 -07:00
Mitchell Sternke
3f77e14347 Added grouping between system/user dbs when listing (#70) 2016-09-29 11:57:28 -07:00
Karl Burtram
3777cceb57 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.
2016-09-26 20:11:26 -07:00
Karl Burtram
8b6e15a43b Bump SMO to 140.1.6 to pick up perf fixes (#69) 2016-09-26 16:21:00 -07:00
Brian O'Neill
57278d9322 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
2016-09-26 15:42:48 -07:00
Karl Burtram
5a198e3f45 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.
2016-09-26 10:29:49 -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
Karl Burtram
27e092d370 Remove deleted file with whitespace name 2016-09-23 10:51:53 -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
Benjamin Russell
93a75f1ff4 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
2016-09-22 12:00:32 -07:00
Benjamin Russell
1f0240dbe0 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.
2016-09-22 11:12:37 -07:00
Benjamin Russell
1f7de91cc5 Bug/negativeOneRowsAffected strings file fix (#61)
* Adding changes to sr.strings files
2016-09-22 11:11:59 -07:00
Mitchell Sternke
803a19d716 Made connection errors more user-friendly (#57) 2016-09-21 11:59:03 -07:00
Karl Burtram
159362f01b Disable failing test while investigating 2016-09-20 23:52:31 -07:00
Karl Burtram
7d6aabb618 Fix build break in row count merge 2016-09-20 21:10:22 -07:00
Karl Burtram
7226240b80 Merge pull request #60 from Microsoft/dev
Merge to master Fixing bug with incorrect row count returned (#58)
2016-09-20 21:05:07 -07:00
Benjamin Russell
8f4caa80c2 Fixing bug with incorrect row count returned (#58) 2016-09-20 21:04:22 -07:00
Karl Burtram
20a3bf4aae Merge pull request #59 from Microsoft/dev
Merge dev to master for dogfood1 re-release
2016-09-20 20:51:15 -07:00
Karl Burtram
bf6a0e52e2 Merge pull request #54 from Microsoft/feature/autocompFixes
Merge autocomplete improvements to dev
2016-09-20 17:26:05 -07:00
Karl Burtram
701aba8d46 Add some tests to increase code coverage metrics 2016-09-19 18:21:48 -07:00
Karl Burtram
0bd7edecf1 Check if script is output window before parsing. 2016-09-19 14:00:10 -07:00
Karl Burtram
30a6fdd26c Fix Connection tests break 2016-09-19 12:35:59 -07:00
Karl Burtram
03315475cb Misc. cleanup for PR 2016-09-19 12:32:56 -07:00
Karl Burtram
44914aa8b9 Move ParseBind out of locked block 2016-09-18 23:20:43 -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
Karl Burtram
108b7cc7e1 Merge pull request #53 from Microsoft/dev
Merge to master for dogfood release.
2016-09-15 10:27:36 -07:00
Sharon Ravindran
55047a0196 Save results to JSON file (#49)
* Save results to JSON file

* Code cleanup

* Code review changes

*  Changed comment
2016-09-14 16:43:10 -07:00
Mitchell Sternke
fbf457a336 Fixed build issue with dependency in project.json (#51) 2016-09-14 13:04:49 -07:00
Karl Burtram
2fbe39b637 Make the log file name unique per session (#50)
* Make the log file name unique per session

* Try to use PID for unique ID
2016-09-14 12:30:16 -07:00
Benjamin Russell
938ebb69e0 Adding SRGen to build scripts (#45)
* Adding SRGen to build scripts

Adding support for sr.strings files. sr.strings files can be converted
into .resx and designer cs files by running the SRGen Cake target
Adding a new target to Cake script to run SRGen. SRGen is pulled down as a
nuget package for Cake and executes from the .tools folder.
Adding Cake temp environment to the gitignore
Adding the cake scripts to the sqltoolsservice solution file

* Fixes from pull request comments

* Fix as per @llali

* Actual changes as per @llali

* removing platform type from netcore dependency
2016-09-14 10:29:34 -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
Benjamin Russell
92eb1376c1 Fixing column datatype issues (#48)
This was an issue where non-string types were being read back as strings (ie, int was read back as a string) resulting in the objects coming back being completely unintelligible values. It was a very simple issue where the column datatype wasn't being set correctly in our wrapper type.
2016-09-13 15:48:30 -07:00
Karl Burtram
1671f762bf Autocomplete bug fixes (#43)
Fix-up the autocomplete support to better handle binding timeouts.
Also provide a default keyword suggestion list.
2016-09-13 15:22:57 -07:00
Karl Burtram
222f9364d8 Jenkins code coverage integration (#47) 2016-09-12 22:05:45 -07:00