Commit Graph

8 Commits

Author SHA1 Message Date
Leila Lali
e7b76a6dec Feature/script execute (#563)
* added script as execute for stored procedures
2017-12-05 13:17:51 -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
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
Aditya Bist
05702182ab Task/script refactor (#476)
* 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
2017-10-03 14:41:18 -07:00
Aditya Bist
e7756b0bf1 Task/script refactor (#446)
* 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
2017-10-02 12:02:43 -07:00
Brian O'Neill
a4a27f9559 Merging mssql-scripter changes (#430)
* Manual port of latest 'feature/mssq-scripter' branch

* Bumpnuget package SqlScriptPublishModel.140.2.0 to Microsoft.SqlServer.Management.SqlScriptPublishModel.140.2.3

* In TestDriver, fix the path to Microsoft.SqlTools.ServiceLayer.exe after move to .NET Core 2.0
2017-08-09 08:25:13 -07:00
Brian O'Neill
8a54435a9c Fix scripting data in the scripting service (#337)
A regression was introduced in the scripting service refactoring where data is no longer scripted. This commit fixes the issue, and updates the tests to catch this in the future.

The issue is in the getter for SqlScriptPublishModel.AdvancedOptions, there is some strange logic which will cause the SqlScriptPublishModel.AdvancedOptions to get reset and lose all values based the ordering of when SqlScriptPublishModel.ScriptAllObjects is set.  In the scripting service refactoring, we started to hit this reset of the AdvanceOptions, which would lose the option to script data, along with other options.

To workaround this, we initialize with SqlScriptPublishModel.ScriptAllObjects to true, and then set all SqlScriptPublishModel.AdvancedOptions values.  Then, we set SqlScriptPublishModel.ScriptAllObjects, and avoid calling the SqlScriptPublishModel.AdvancedOptions getter.

Also including some misc scripting service changes:
1) Adding a sequence number field to the scripting operation events
2) Adding a error message to scripting progress events
3) Expect a null scripting option parameter
4) Correctly set the exception message and details for json-rpc events
5) More logging
2017-05-10 12:06:59 -07:00
Brian O'Neill
4aac4a4047 Add scripting API implemented by the SqlScriptPublishModel (#316)
Update the ScriptingService to expose new scripting JSON-RPC APIs that use the SqlScriptPublishModel for script generation.

The SqlScriptPublishModel is the model behind the SSMS scripting wizard. To enable scripting for CLI tools, we've ported SqlScriptPublishModel to .NET Core. The SqlScriptPublishModel wraps the SMO scripting APIs for .sql script generation.

1) Added three new requests to the ScriptingService: ScriptingRequest, ScriptingListObjectsRequest, ScriptingCancelRequest.
2) Generating scripts are long running operations, so the ScriptingRequest and ScriptingListObjectsRequest kick off a long running scripting task and return immediately.
3) Long running scripting task reports progress and completion, and can be cancelled by a ScriptingCancelRequest request.
4) Bumped the SMO nuget package to 140.17049.0. This new version contains a signed SSMS_Rel build of SMO with the SqlScriptPublishModel.
5) For testing, adding the Northwind database schema

TODO (in later pull requests)
1) Integrate the new ScriptingService APIs with the ConnectionService
2) Integrate with the metadata support recently added
2017-04-24 16:10:20 -07:00