* initial commit
* Initial SqlProjects service + tests
* Added SqlObject script tests; PR feedback
* Added comments for contracts
* Swapping SqlProjectResult for ResultStatus
* Updating tests
* Added automatic test base that provides a working directory and automatic cleanup.
* Enabled backup to and restore from URL
* Created RPC, but when process tries to load Microsoft.Azure.Storage.Blob.dll, it crashes
* Added create shared access token
* Code refactor
* Minor changes
* Changed RPC path
* Moved createSas RPC to the newly created BlobService, fixed PR comments
* Added sas expiration date parameter to the RPC
* Added copyright headers
* Removed ConnectionInstance property from BlobService
* Removed unhelpful comment
* Removed unused using statements
* Changed copy/paste comments
* Disposable objects fix
* Small formatting fix
* Changed backup to/restore from url supported device types
* Added backup to url integration test
* Created restore integration test. Test are now getting azure blob params from env variables instead of file.
* Culture invariant epiration date param, fixed comment, and typo
* Updated headers
* PR comments fix
* Changed supported device type logic
* string localization fix
* String formatting fix
* build failure fix
* Typo
* Updated supported restore device types
* Adds new graph comparison request handler to the Execution Plan Service.
* Code review changes
* Renames execution plan compare params, result, and request classes.
* 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
* Adding ExecutionPlanService to ADS
* Changing name to execution plan service
* Renaming file
* Fixing some PR comments
* Renaming class
* Changing api name to queryexecutionplan
* getting table name from a script
* add InsertSqlInputBindingOperation
* cleanup
* move azure functions stuff out of dacfx service
* cleanup
* add tests
* add another test
* cleanup
* add comments and connection string setting
* addressing comments
* change name to use add instead of insert
* Revert "Revert "Initial migration service changes for assessment support (#1093)" (#1098)"
This reverts commit e96c0064ad.
* Move SQL Tools Service last in Main project list
* InsightsGenerator project template files
* Add insights projects to SLN
* Setting up siggen class (#1003)
* Setting up siggen class
* fixed the learn method
* Refactoring code
Fixed compile errors
* renamed results to result
* Basic transformation logic (#1004)
* Fix a couple bugs and add a simple test (#1007)
* Fix a couple bugs and add a simple test
* More tests and bug fix
* Nara/workflow (#1006)
* added a queue processor
* ordered using statements
* Armemon/analytics (#1008)
* Basic transformation logic
* changed some structure of siggen
* added sum and average method, as well as select rows by input name
* add insights to results
* min, max added
Co-authored-by: Karl Burtram <karlb@microsoft.com>
Co-authored-by: Aasim Khan <aasimkhan30@gmail.com>
Co-authored-by: Arslan Memon <armemon@microsoft.com>
* Added rules engine base implementation (#1005)
* Added rules engine base implementation
* update comments
* addressing comments
* adding template text to columnheaders object
* adding template text to columnheaders object
* fixing columnheaders class
* Added test
* Added Template Parser unit test in Test project
* Deleted unnecessary files and reverted the files that were modified by mistake
Co-authored-by: Jinjing Arima <jiarima@microsoft.com>
* Insights generator message handler placeholder (#1013)
* Aasim/insights/insight methods (#1014)
* Basic transformation logic
* changed some structure of siggen
* Added top and bottom insight functions
* Added top, bottom insights
Added tests for top, bottom insights
* Armemon/insights2 (#1011)
* max and min insightsperslice, and tests
* got rid of unneccesssary function
* get indexes
Co-authored-by: Arslan Memon <armemon@microsoft.com>
* Armemon/insights2 (#1012)
* max and min insightsperslice, and tests
* got rid of unneccesssary function
* get indexes
* learn for stringinputtyype
* add learn implentation
Co-authored-by: Arslan Memon <armemon@microsoft.com>
* Added Tests
Removed duplicate methods
Co-authored-by: Karl Burtram <karlb@microsoft.com>
Co-authored-by: arslan9955 <53170027+arslan9955@users.noreply.github.com>
Co-authored-by: Arslan Memon <armemon@microsoft.com>
* Armemon/insights2 (#1016)
* Basic transformation logic
* changed some structure of siggen
* Added top and bottom insight functions
* Added top, bottom insights
Added tests for top, bottom insights
* max and min insightsperslice, and tests
* got rid of unneccesssary function
* get indexes
* learn for stringinputtyype
* add learn implentation
* add unique inputs
* fix merge error
* add to result
Co-authored-by: Karl Burtram <karlb@microsoft.com>
Co-authored-by: Aasim Khan <aasimkhan30@gmail.com>
Co-authored-by: Arslan Memon <armemon@microsoft.com>
* Added all the templates (#1015)
* Added all the templates
Added a method to find matched template
* Added a function to replace # and ## values in a template
* Added ReplaceHashesInTemplate call
* Added comments
* Updated the template txt
* Updated GetTopHeadersWithHash function to add #toplist
* Updated the logic per offline discussion with Hermineh
* Update request handler contract to take array (#1020)
* added rulesengine findmatchingtemplate (#1019)
* Add support for getting DacFx deploy options from a publish profile (#995)
* add support for getting options from a publish profile
* update comments
* set values for default options if they aren't specified in the publish profile
* addressing comments
* Updating to latest DacFx for a bug fix (#1010)
* added rulesengine findmatchingtemplate
* Update DacFx deploy and generate script with options (#998)
* update deploy and generate script to accept deployment options
* add tests
* add test with option set to true
* merge
* merge
* incorporated FindMatchedTemplate
Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com>
Co-authored-by: Udeesha Gautam <46980425+udeeshagautam@users.noreply.github.com>
* -Added logic for Insights Generator Service Handler (#1017)
* -Added logic for Insights Generator Service Handler
* Fixed some logic
* Adding workflow test
* Update transform and add tests (#1024)
* Jiarima/fix rules engine logic (#1021)
* Added all the templates
Added a method to find matched template
* Added a function to replace # and ## values in a template
* Added ReplaceHashesInTemplate call
* Added comments
* Updated the template txt
* Updated GetTopHeadersWithHash function to add #toplist
* Updated the logic per offline discussion with Hermineh
* Update with the fixes
* Updated template and foreach conditions
* Added distinct
* Updated tests according to the logic change (#1026)
* Nara/remove queing (#1023)
* loc update (#914)
* loc update
* loc updates
* Add support for getting DacFx deploy options from a publish profile (#995)
* add support for getting options from a publish profile
* update comments
* set values for default options if they aren't specified in the publish profile
* addressing comments
* Updating to latest DacFx for a bug fix (#1010)
* Update DacFx deploy and generate script with options (#998)
* update deploy and generate script to accept deployment options
* add tests
* add test with option set to true
* intermediate check in for merge, transformed not working
* intermediate check in for merge, transformed not working
* added test case
* merged
Co-authored-by: khoiph1 <khoiph@microsoft.com>
Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com>
Co-authored-by: Udeesha Gautam <46980425+udeeshagautam@users.noreply.github.com>
* Output data types from transform (#1029)
* Fix bug process input_g (#1030)
* Fixed the insight generator service (#1028)
* Jiarima/added more testings (#1031)
* Added another test
Updated ReplaceHashesInTemplate function to return string instead of Template
* Added third test
* Merged
* Reverted the workflow file to match with the one in hack/insights
* Bugs fixes to hook insights up to ADS (#1033)
* Bug fixes for hack insights (#1032)
* Fixed the minColumn index bug in Data Transformation
Fixed the template matching logic.
* Adding changes from PR
* Try to fix Workflow tests
* Readd workflow tests
* Fix template load location
Co-authored-by: Aasim Khan <aasimkhan30@gmail.com>
Co-authored-by: Nara <NaraVen@users.noreply.github.com>
Co-authored-by: arslan9955 <53170027+arslan9955@users.noreply.github.com>
Co-authored-by: Arslan Memon <armemon@microsoft.com>
Co-authored-by: gadudhbh <68879970+gadudhbh@users.noreply.github.com>
Co-authored-by: Jinjing Arima <jiarima@microsoft.com>
Co-authored-by: jiarima <68882862+jiarima@users.noreply.github.com>
Co-authored-by: Kim Santiago <31145923+kisantia@users.noreply.github.com>
Co-authored-by: Udeesha Gautam <46980425+udeeshagautam@users.noreply.github.com>
Co-authored-by: khoiph1 <khoiph@microsoft.com>
[SQL Assessment API](https://docs.microsoft.com/en-us/sql/sql-assessment-api/sql-assessment-api-overview) provides a mechanism to evaluate the configuration
of SQL Server for best practices. SQL Assessment API gives a list
of recommended actions to improve SQL Server performance or security.
The SQL Assessment service is used by the expected SQL Assessment
feature of Azure Data Studio.
SqlAssessmentService forwards JSONRPC calls to SQL Assessment engine
and wraps results as a response.
`assessment/getAssessmentItems` returns a set of checks
applicable to a given target.
`assessment/invoke` returns a set of recommendations
for improving SQL Server instance or database configurations.
`assessment/generateScript` returns a T-SQL script for storing
an assessment result set to a SQL data table.
* initial open scmp changes
* more open scmp changes and adding tests
* moving some common test code
* simplify endpoint info parsing
* addressing comments and moving more common test code
* addressing comments
* successfully sends list of differences to ADS
* bumping dacfx nuget package version
* add second schema compare try for case when first db to db comparison fails but works on second try
* move schemacompare out of dacfx folders
* capitalizing
* more capitalizing
* addressing comments
* First cut of CMS get Server Api - returns only names
* Adding Proper naming and some more functions
* Adding add remove Server and tests for it
* Changing relative path to derive from KeyChain.Urn and Nuget update
* Adding async thread for requests
* Addressing CR comments and adding one more test
* Adressed PR comments around naming
* Initial non-refactored SQL Agent alert classes (WIP)
* Move agent classes into subdirectories
* Refactor the agent config code a bit more
* Add more implementation for handlers
* Add more code to the create alert handler
* Clean up agent alert class
* Clean up alert methods a bit
* Initial Operator contracts
* Additonal SQL Agent config changes
* More Proxy config cleanup
* Cleanup AgentProxy class
* Additional cleanups
* Run SRGen
* Add security service to create credential objects
* Bump SMO to 140.2.5 to pick-up private XEvent binaries
* Pick up SMO binaries from the build lab
* Add ProfilerService class placeholder
* Update SMO nuget package to include DB Scoped XEvents
* Stage changes
* Stage changes
* Update SMO to use RTM dependencies and remove separate SqlScript package
* Stage changes
* Iterate on profiler service
* Fix post-merge break in localization
* More refactoring
* Continue iterating on profiler
* Add test profiler listener
* Address a couple of the code review feedback
* Fix AppVeyor build break
* Use self-cleaning test file
* added a binding queue for oe to force one operation on a node at a time
* setting node subtype to temporal for temporal tables
* disposing oe service on shutdown
* Add initial services for admin, tasks, and DR
* Fix up some of the contract interfaces
* Make fields public to allow Json.Net to work
* Fix a couple issues in backup contracts
* Initial metadata service and scripting service files
* Simple metadata lookup with SMO objects
* Add metadata type class
* Remove SMO from metadata service.
* Cleanup metadata service SQL
* Initial MetadataService test
* Add scripting commands
* Add metadata test case
* Remove sleep used for testing
* Use random table name in metadata test
* Add scripting tests
This is a very large change. I'll try to outline what's going on.
1. This adds the **EditDataService** which manages editing **Sessions**.
1. Each session has a **ResultSet** (from the QueryExecutionService) which has the rows of the table and basic metadata about the columns
2. Each session also has an **IEditTableMetadata** implementation which is derived from SMO metadata which provides more in-depth and trustworthy data about the table than SqlClient alone can.
3. Each session holds a list of **RowEditBase** abstract class implementations
1. **RowUpdate** - Update cells in a row (generates `UPDATE` statement)
2. **RowDelete** - Delete an entire row (generates `DELETE` statement)
3. **RowCreate** - Add a new row (generates `INSERT INTO` statement)
4. Row edits have a collection of **CellUpdates** that hold updates for individual cells (except for RowDelete)
1. Cell updates are generated from text
5. RowEditBase offers some baseline functionality
1. Generation of `WHERE` clauses (which can be parameterized)
2. Validation of whether a column can be updated
2. New API Actions
1. edit/initialize - Queries for the contents of a table/view, builds SMO metadata, sets up a session
2. edit/createRow - Adds a new RowCreate to the Session
3. edit/deleteRow - Adds a new RowDelete to the Session
4. edit/updateCell - Adds a CellUpdate to a RowCreate or RowUpdate in the Session
5. edit/revertRow - Removes a RowCreate, RowDelete, or RowUpdate from the Session
6. edit/script - Generates a script for the changes in the Session and stores to disk
7. edit/dispose - Removes a Session and releases the query
3. Smaller updates (unit test mock improvements, tweaks to query execution service)
**There are more updates planned -- this is just to get eyeballs on the main body of code**
* Initial stubs for edit data service
* Stubbing out update management code
* Adding rudimentary dispose request
* More stubbing out of update row code
* Adding complete edit command contracts, stubbing out request handlers
* Adding basic implementation of get script
* More in progress work to implement base of row edits
* More in progress work to implement base of row edits
* Adding string => object conversion logic and various cleanup
* Adding a formatter for using values in scripts
* Splitting IMessageSender into IEventSender and IRequestSender
* Adding inter-service method for executing queries
* Adding inter-service method for disposing of a query
* Changing edit contract to include the object to edit
* Fully fleshing out edit session initialization
* Generation of delete scripts is working
* Adding scripter for update statements
* Adding scripting functionality for INSERT statements
* Insert, Update, and Delete all working with SMO metadata
* Polishing for SqlScriptFormatter
* Unit tests and reworked byte[] conversion
* Replacing the awful and inflexible Dictionary<string, string>[][] with a much better test data set class
* Fixing syntax error in generated UPDATE statements
* Adding unit tests for RowCreate
* Adding tests for the row edit base class
* Adding row delete tests
* Adding RowUpdate tests, validation for number of key columns
* Adding tests for the unit class
* Adding get script tests for the session
* Service integration tests, except initialization tests
* Service integration tests, except initialization tests
* Adding messages to sr.strings
* Adding messages to sr.strings
* Fixing broken unit tests
* Adding factory pattern for SMO metadata provider
* Copyright and other comments
* Addressing first round of comments
* Refactoring EditDataService to have a single method for handling
session-dependent operations
* Refactoring Edit Data contracts to inherit from a Session and Row
operation params base class
* Copyright additions
* Small tweak to strings
* Updated unit tests to test the refactors
* More revisions as per pull request comments
- TSqlFormatterService with support for formatting document and text range inside document
- Settings support for all formatting options.
- Extensibility support so that the service can be initialized using MEF extensibility, and can find all necessary TSqlFormatters using the same process
Fix Initialize request error on startup
- Messages were being read from the input channel before all request handlers were registered
- In particular, the Initialize request which is key for any server to talk to the client was getting lost because the message reader thread begins consuming, and we take an extra few hundred milliseconds due to MEF startup before we register the handler
- The solution is to initialize the message handler so request handlers can register, but not actually start processing incoming messages until all handers are ready. This is a safer way to go and should improve reliability overall
Improvements from internal prototype:
- Normalizing baselines to handle the line ending differences on Mac & Linux vs. Windows
- Significantly shortened most lines by implementing base class methods to wrap common objects from Visitor.Context and removing unnecessary "this." syntax
- Refactored the SqlCommonTableExpressionFormatter and related classes to reduce code count significantly. This provides a pattern to follow when refactoring other classes for similar clarity. It's likely a lot of common logic could be found and reused across these.
- Reduced overall code size by adding utility methods