Commit Graph

45 Commits

Author SHA1 Message Date
Cheena Malhotra
187b6ecc14 Introduce AAD interactive auth mode (#1860) 2023-03-02 09:39:54 -08:00
Cheena Malhotra
86a8861e78 Build with .NET 7.0.200 + Async improvements (#1869) 2023-02-17 09:54:20 -08:00
Aasim Khan
0f82062502 Removing migration code and packages from sts (#1864)
* Removing migration code and packages from sts

* Removing condition
2023-02-15 22:10:30 -08:00
Karl Burtram
f288bee294 Make nullable warnings a per file opt-in (#1842)
* Make nullable warnings a per file opt-in

* Remove unneeded compiler directives

* Remove compiler directive for User Data
2023-02-03 18:10:07 -08:00
Benjin Dubishar
e2962390bc Support for SqlCmdVariables in SqlProjects service (#1831)
* Support for SqlCmdVariables

* Adding comments

* Adding update sqlcmdvar method

* swapping for success asserts
2023-01-30 15:45:15 -08:00
Benjin Dubishar
9cce26fcbd Initial check-in of SqlProjects service addition to SqlToolsService (#1805)
* 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.
2023-01-25 14:16:15 -08:00
Karl Burtram
c9f310cb47 Remove InsightsGenerator project (#1764) 2022-12-07 10:56:12 -08:00
M-Patrone
88eaa64755 Feature rename sql objects (#1686) 2022-09-22 14:42:23 -07:00
Charles Gagnon
019481e8db Use MemoryStream instead of stdout for outgoing messages during integration tests (#1696)
* filter

* test

* run all

* Redirect to memorystream

* revert temp changes
2022-09-16 15:38:53 -07:00
Cory Rivera
c3b5831c89 Add dotnet tool build steps to SQL Tools & Kusto csproj files. (#1573) 2022-07-12 16:18:11 -07:00
Benjamin Russell
97a106c575 Removing a lot of redundant async/await wrappers (#1486)
* Removing a lot of redundant async/await wrappers

* Removing kusto changes
2022-06-05 08:26:21 -07:00
Nemanja Milovančević
881c335cdf Backup/Restore Managed Instance (#1428)
* 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
2022-04-20 14:01:13 -07:00
Lewis Sanchez
8215d88dcf Adds new graph comparison request handler to the Execution Plan Service. (#1438)
* Adds new graph comparison request handler to the Execution Plan Service.

* Code review changes

* Renames execution plan compare params, result, and request classes.
2022-03-22 14:52:42 -07:00
Lewis Sanchez
f7b37091ca Renames ShowPlan directories along with corresponding namespaces (#1435)
* 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
2022-03-21 16:25:44 -07:00
Aasim Khan
aa97389d8e Adding ExecutionPlanService to ADS (#1422)
* Adding ExecutionPlanService to ADS

* Changing name to execution plan service

* Renaming file

* Fixing some PR comments

* Renaming class

* Changing api name to queryexecutionplan
2022-03-12 00:49:17 -08:00
Charles Gagnon
c248400a6c Add linting for copyright and unused usings (#1416)
* Add linting for copyright and unused usings

* Add one more + comment

* Enforce in build and fix errors

* Fix build
2022-03-04 15:17:29 -08:00
Alan Ren
791c3594a9 add table designer handlers (#1269)
* add table designer handlers

* add comments
2021-10-14 13:39:55 -07:00
Kim Santiago
b1653b25e4 Insert sql bindings into Azure Functions (#1224)
* 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
2021-08-04 13:02:52 -07:00
Leila Lali
01d0f03262 Added service for model management for machine learning extension (#1138)
* Added service for model management for ml extension
2021-01-19 11:33:55 -08:00
Karl Burtram
b9e1618260 Revert "Rollback migration changes" (#1099)
* Revert "Revert "Initial migration service changes for assessment support (#1093)" (#1098)"

This reverts commit e96c0064ad.

* Move SQL Tools Service last in Main project list
2020-10-16 16:29:22 -07:00
Charles Gagnon
e96c0064ad Revert "Initial migration service changes for assessment support (#1093)" (#1098)
This reverts commit 1a0388c8cb.
2020-10-16 13:35:59 -07:00
Charles Gagnon
b64d5a3146 Fix Notebook Convert namespace (#1097) 2020-10-16 12:27:54 -07:00
Karl Burtram
1a0388c8cb Initial migration service changes for assessment support (#1093)
* Migration service WIP 1

* Assessment DLLs

* WIP

* WIP 2

* Add migration nuget package

* WIP2

* Fix up assessment handler

* WIP

* Fix build scripts

* WIP

* Update Assessment references

* Fix metadata copy to work with publish
2020-10-13 11:02:29 -07:00
Karl Burtram
3393e31f55 Remove kustoservicelayer from SQL Tools Service load (#1068) 2020-09-04 10:09:15 -07:00
Karl Burtram
5cf5b59a0d Insights generator project (#1066)
* 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>
2020-09-03 14:15:51 -07:00
Charles Gagnon
9fbcadb46e Add service for converting a notebook to sql and back (#1022) 2020-07-29 16:31:51 -07:00
Aleksei Guzev
bcc1f2a486 Add AQL Assessment service (#946)
[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.
2020-04-24 10:52:55 +03:00
Leila Lali
73fc70fbbc Adding service operations for external languages (#918)
* Added service operations for external languages
2020-02-21 08:52:58 -08:00
Leila Lali
3626d000fd Added service class for machine learning services operations (#906)
* Added service class for server configurations and language extension
2020-01-15 11:21:07 -08:00
Kim Santiago
b451670222 Schema Compare open SCMP file (#825)
* 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
2019-06-13 14:24:19 -07:00
kisantia
01bcfd8df9 Add Schema Compare (#777)
* 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
2019-03-05 11:43:06 -08:00
udeeshagautam
9551022fff Feature/cms backend (#776)
* 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
2019-03-01 11:55:19 -08:00
kisantia
d5fd968b3c DacFx import/export (#728)
Adding DacFx import/export/deploy/extract functionality
2018-11-27 16:10:46 -08:00
Karl Burtram
4f214f43e9 SQL Agent configuration for Operators, Alerts and Proxies (WIP) (#621)
* 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
2018-05-30 08:58:02 -07:00
Karl Burtram
376cc21f12 Initial SQL Agent merge for March release (#595)
* Initial SQL Agent WIP

* Fix test build break

* wip

* wip2

* additonal SQL Agent history parsing code

* Fix namespace sorting

* Hook up agent\jobs method

* Fix broken integration test build

* Added handler for job history request (#586)

* fixed agent service tests

* added job history handler

* code review refactoring

* Turn off another failing test

* Disable failing test

* Feature/agent1 adbist (#592)

* fixed agent service tests

* added job history handler

* code review refactoring

* refactored code

* small refactor

* code review changes

* Remove unused code

* Remove unused test file

* Feature/agent1 adbist (#593)

* fixed agent service tests

* added job history handler

* code review refactoring

* refactored code

* small refactor

* code review changes

* changed constant casing

* added handler for job actions

* Reenable disabled test

* cleaned up code
2018-03-23 13:25:37 -07:00
Kate Shin
b46c4b4381 Fix issues in file browser service (#469)
* fix file browser service bug

* modify filebrowser service

* change filebrowser contract

* fix contract

* fix file browser add/expand event contracts

* remove commented code
2017-09-28 13:02:57 -07:00
Karl Burtram
84ea045572 XEvent Profiler initial event handlers (#456)
* 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
2017-09-12 14:08:50 -07:00
Leila Lali
eb61423f89 added a binding queue for oe to force one operation on a node at a time (#441)
* 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
2017-08-22 15:15:01 -07:00
Leila Lali
1511f73672 fixed the issue with resources not disposed correctly (#439)
* fixed the issue with resources not disposed correctly

* disposing language service at shutdown
2017-08-21 14:32:48 -07:00
Karl Burtram
1a16101381 Initial admin and DR services. (#329)
* 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
2017-04-26 10:29:15 -07:00
Leila Lali
d903ba56a9 Object Explorer Service (#311)
* moving OE service from an old branch
2017-04-11 15:50:20 -07:00
Karl Burtram
7ba2011a1e Initial metadata and scripting services (#280)
* 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
2017-03-14 22:35:17 -07:00
Karl Burtram
f00136cffb Fix namespaces for code moved to separate class libraries (#263)
* Create ServiceHost a service-specific class

* Renaming hosting namespace

* Rename credentials namespace

* Fix namespaces
2017-03-02 14:41:06 -08:00
Benjamin Russell
795eba3da6 Edit Data Service (#241)
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
2017-02-22 17:32:57 -08:00
Kevin Cunnane
7477642854 TSQL Formatter Service (#229)
- 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
2017-02-14 23:40:17 -08:00