* Minimal changes to make headers appear on empty result sets
* Columns for everyone!
* Updating tests - some don't pass yet
* Adding some more tests to verify the changes for column/row selection
* null default columns
* Updates to comments as per PR comments
* Renames ShowPlan directories along with corresponding namespaces
* Renames ShowPlanGraphUtils to ExecutionPlanGraphUtils
* Revert "Renames ShowPlanGraphUtils to ExecutionPlanGraphUtils"
This reverts commit 5dc2696ae906598447eed7360a3f342218432b83.
* Reverts show plan tests name change.
* Renames show plan test XML files.
* Renames ported directory to ShowPlan and updates namespace accordingly
* added wip rename query
* added first rename test
* added missing query handling and two new tests
* removed ServiceDispose
* added change to owneruri.
* made fields private, used accessor methods
* added readonly flag back
* added didSave to sqltools.servicelayer
* fix for docsavecallbacks
* removed tryremove
* test disconnect in queryExecutionService
* removed debug message working query.
* added comment to handlerenamerequest
* added uri replacement function
* removed duplicate removemap function
* added minor fixes
* changed connectionOwnerUri to getter setter
* removed handledidsave and added setters
* removed additional save parts
* fixed space issues
* more fixes for spaces
* restored spaces
* fixed workspaceservice
* Update TextDocument.cs
* changed renameRequest into notification WIP
* restored textdocument
* restored textdocument.cs
* added rightwards arrow
* renamed rename to ChangeConnectionUri
* added more renames
* rename changeconnectionuri to changeuri
* renamed file names
* Revert "renamed file names"
This reverts commit 55228e65025b5179b15ae9a0adc095d95538723d.
* Revert "rename changeconnectionuri to changeuri"
This reverts commit 23f3813f609e3947f103e057f7c0919184075bdc.
* removed logging message and other small changes
* renamed class and method
* Remove xunit dependency from testdriver
* swap expected/actual as needed
* Convert Test.Common to nunit
* port hosting unit tests to nunit
* port batchparser integration tests to nunit
* port testdriver.tests to nunit
* fix target to copy dependency
* port servicelayer unittests to nunit
* more unit test fixes
* port integration tests to nunit
* fix test method type
* try using latest windows build for PRs
* reduce test memory use
* 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
* 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
* 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
* 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
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
* 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
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
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
* Reopen connections prior to creating query execution data readers
* Reopen connection if an exception was rasied executing the query
* Fix unit tests
* 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
* 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
* Adding unit tests for save as excel
* Adding unit test for revert cell integration
* Adding unit test for edit session initialization
* Fixing issue where excel file factory wasn't being overridden
* Fixing issue where Guids weren't being stored in the service buffer file as Guids
* Removing unnecessary ReadSqlGuid method
* Adding unit test for revert cell integration
* Adding unit test for edit session initialization
* Revert "Adding unit test for revert cell integration"
This reverts commit a949926f2ebbb0c39f776edba76d999af4f3f3e9.
* Revert "Adding unit test for edit session initialization"
This reverts commit ff9e5a7d0e5392b27257e57db64879699d73d21c.
* Initial changes to have serialization generate its own .exe
* Removed additional project from sln file
* remove all references to removed temporary project
* Moved shared contracts into own dll and fixed imports. Addressed PR comments
* Undid having a separate contracts project since that'll be a task for later on. Moved dbcellvalue and saveresultsrequest to Hosting, where they will be imported and shared by the service layer and serialization projects
* Switched backslashes in project reference in csproj file to forward slashes for consistency
* Moved necessary contracts back to service layer. Refactored CommandOptions to reduce code duplication. Addressed miscellaneous PR suggestions
* Accidentally left these files out of previous commit
* Initialized loggers for serialization and credentials with the logging directory provided by the cmd line arg, if there is one
* Changed default log directory paths for serialization and credentials. Removed unnecessary cast and added a copyright
* Changed name of generated executable for serialization service
* removed unnecessary object cast
* removing unnecessary imports and addressing other PR comments
* change simple execute to open a new connection and close it every query
* updated tests for simple execute
* removed an unnecessary connect
* refactored code to be more readable
* global try catch on simple execute
* added multiple execution test
* update execution to be asynchrous; update tests to account for asynchrounous nature
* Support "SQL" settings in addition to MSSQL
- Handles having 2 separate configuration definitions and merging / treating them as 1 throughout the app
- If a settings group such as Intellisense is defined on mssql, it will override any generic SQL properties
- Retains backwards compatibility with existing settings.
* inital request
* refactored query execution failure callback to take exception
* added failure callback to execute and return
* added test for query execute and return
* updated params
* removed dead code
* addressed feedback; added multiple active result set support; updated tests
* addessed feedback and added testing and errors and verification
* change <= to ==
* changed name of trashQ to removedQuery
Update to include the Row ID with a DbCellValue. This will be super useful to us for the purposes of managing individual rows via slick grid.
Although this changes the API for edit/subset and query/subset, it is effectively backwards compatible since it's adding a parameter, not removing anything.
* New DbCellValue has an internal Row ID
* Adding unit tests
This change ensures that when calling `requestContext.SendError` you are only able to supply parameters that match the language service beta protocol expected Error object. In other words, you have to provide an error message and optionally and error code.
# **BREAKING API CHANGES**
This will break displaying errors in Microsoft/vscode-mssql. I will be making changes to properly handle the error object shortly.
* Adding contract for returning Error objects as per LanguageService "protocol"
* Fixes throughout codebase to send only error message in error cases
Cleanup of CredentialServiceTest unit test class
Adding standard error handling for event flow validator
* Adding optional data field as per protocol spec
https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md
* Adding optional validation for error objects
* Major refactor of EditDataMetadata providers
* EditMetadataFactory generates "basic" EditTableMetadata objects based entirely on SMO metadata
* SmoEditTableMetadata no longer depends on SMO, making it unecessary to mock it
* Renamed SmoEditTableMetadata to EditTableMetadata
* EditTableMetadata can be extended with DbColumnWrappers
* Moving logic for extending a EditColumnMetadata into that class
* I *think* this will work for async execution of initialize tasks
* Fixing unit tests for new Edit(Table|Column)Metadata classes
* Async stuff that works! And passes unit tests
* Adding unit tests
Adding .idea to gitignore
* Adding message to the EditSessionReadyEvent
* Fixes from dev merge
* Fixing unit tests that Rider didn't catch as failing
May have been a bit heavy-handed with the async/await stuff
* Couple changes as per PR comments
* Changing query/subset API to only use Result on success, Error on error
* Creating an interservice API for getting query result subsets
* Updates to subset API
* RowStartIndex is now long
* Output of query/subset is a 2D array of DbCellValue
* Adding LongSkip method to LongList to allow skipping ahead by longs
* Moving LongList back to ServiceLayer utilities. Move refactoring
* Stubbing out request for edit/subset
* Initial implementation of getting edit rows
* Unit tests for RowEdit and RowDelete .GetEditRow
* Fixing major bugs in LongList implementation, adding much more thorough tests
* Adding some more unit tests and fixes to make unit tests pass
* Fixing comment
* Fix dispose pattern usage in SaveAsWriterBase
* Add SaveAsExcel feature
This adds the save as excel function to the backend. To reduce large dependency and run on dotnet core now, this implementation use a raw excel writer (the SaveAsExcelFileStreamWriterHelper.cs) instrad of popular excel library, such as EPPlus or OpenXmlSdk.
* Fix can not open the generated excel file in google sheet
For the file name inside excel, google uses a case sensitive path while
Excel doesn't. This change fix the case, so that the file name matches
the one in x1/_rels/workbook.xml.rels
* Fix datetime doesn't recognized by google sheet
Google doesn't support cell type t="d" with ISO 8601 date. (From stackoverflow thread and testing), thus use the old way of excel datetime, which uses double to present datetime
* update to use xmlwriter
* Add basic unit tests for SaveAsExcelFileStreamWriterHelper
* refactor: simplify the public interface of the SaveAsExcelFileStreamWriterHelper
* update private fields names based on the name convention
* Add comments to classes of SaveAsExcel feature
* clean up SaveAsExcelFileStreamWriterHelper
- change SaveAsExcelFileStreamWriterHelper from public to internal
- remove the PenddingRowEndTag function from referenceManager
- change the SaveAsExcelFileStreamWriterHelper(stream) to default leaveOpen to false to match the normal behavior
- change the rowreference to use XmlConvert to convert int to string
- rename writeSetting to writerSetting and add private
* fix CI test error for SaveAsExcel
* remove ExporterException in SaveAsExcel
* fix lefe over CSV to Excel in the comments
* refactor to be consistent with JsonWriter and remove the comment
* remove commented out test
The test is too slow to run
* fix typo in comment
* refactor SaveAsExcel to the coding standard
* refactor rewrite the WriteStyle with XmlWriter
* Add licence header
* reverse mistakenly checked-in changes
* fix: left-over CSV in commets
* remove duplicate check
The check was done in the IncreaseColumnReference, but that check is too late in case of too many columns. All the addCell do the check at the begining now
* fix TimeSpan more than 24 hours
* fix AddRowMustBeCalledBeforeAddCellException test
This is due to remove duplicate call to AssureColumnReference in WriteAndIncreaseColumnReference
* fix: TimeSpan will write twice
* style: change retun in the switch to break
* Add bool format
* remove todo in comment
This provides extra safeguard in the cost of one memory access when null.