Commit Graph

49 Commits

Author SHA1 Message Date
Alan Ren
bfa40e86e4 handle null ref exceptions in managed parser (#1606)
* handle null ref exceptions

* add comment
2022-07-27 18:35:54 -07:00
Alex Ma
ae90a06026 [Loc] Xlf update 7-11-22 (#1572) 2022-07-11 18:27:21 -07:00
Alex Hsu
a6e9f1a6cf LEGO: Merge pull request 1570
LEGO: Merge pull request 1570
2022-07-09 08:36:10 -07:00
Alex Hsu
2d90b472b2 LEGO: Merge pull request 1568
LEGO: Merge pull request 1568
2022-07-08 08:35:27 -07:00
Charles Gagnon
ac9f88266c BatchParser target netstandard2.0 and remove Hosting dependency (#1564)
* Remove Hosting dependency from BatchParser, wip for logging replacement

* netstandard2.0 and fixes

* comment + cleanup

* comment

* fix build

* Update newtonsoft

* localize errors
2022-07-06 15:26:06 -07:00
Charles Gagnon
dd11be3d38 Consolidate to net6.0 (#1547)
* Add SqlClient event listener

* comments

* ensure not disposed early

* initial

* net6.0

* undo
2022-06-21 08:53:23 -07:00
Charles Gagnon
b182e9fe53 Bump SMO to 161.47021.0 (#1538) 2022-06-10 13:02:49 -07:00
Karl Burtram
a70402fe60 Revert SMO bump (#1492) 2022-05-11 15:34:15 -07:00
Charles Gagnon
fb1a12c6d2 Don't query for unsupported properties (#1471)
* Don't query for unsupported properties

* add using
2022-05-06 12:53:04 -07:00
Charles Gagnon
6c97f41f7b Bump SMO + SqlClient (#1478) 2022-04-26 16:01:55 -07: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
Alex Ma
a98c266791 Use old dotnet embedded resource convention (#1374)
* use old dotnet embedded resource convention flag

* fixed positioning

* another tab fix
2022-01-27 13:48:11 -08:00
Alex Ma
faaf062f0f [Loc] Update to xlfs and resx files (#1332) 2021-12-06 19:05:58 -08:00
csigs
ec5d5c86bf LEGO: Merge pull request 1331
LEGO: Merge pull request 1331
2021-12-04 08:33:27 -08:00
csigs
f9080a6e12 LEGO: Merge pull request 1329
LEGO: Merge pull request 1329
2021-12-03 08:33:32 -08:00
csigs
ec9294202e LEGO: Merge pull request 1328
LEGO: Merge pull request 1328
2021-12-02 11:06:09 -08:00
Alex Ma
f9e7b22697 Consolidate Loc Files to one (#1325)
* Added locproject to defaultimpl

* added resourceprovider core

* added more locprojects for rest of projects

* moved LocProject to src

* Added consolidated locproject

* deleted old locprojects

* fix tab to better match ADS

* Revert "fix tab to better match ADS"

This reverts commit e3e3370ac9eb647b94b908e0432fbc52a9874b41.
2021-12-01 09:49:27 -08:00
Alex Ma
1bae482a8d Loc for other projects. (#1323)
* Added locproject to defaultimpl

* added resourceprovider core

* added more locprojects for rest of projects
2021-11-29 12:50:52 -08:00
Sai Avishkar Sreerama
1ab2edea94 Updating ManagedBatchParser project target framework to netstandard2.1 as the… (#1303)
* Updating ManagedBatchParser target framework to netstandard2.1 as the DacFx is changes to 2.1 with 160 vbump.

* moving TargetFramework tag to the props file

* Updated the managed batch parser framework tag name.
2021-11-15 11:45:39 -06:00
Alan Ren
e305d30004 load the schema information (#1274)
* load the schema information

* pr comments
2021-10-20 12:54:54 -07:00
Aasim Khan
f8664641cf Fixing GetServerSystemInfo for Azure DBs (#1231)
* Not throwing errors when we try to fetch SQL server properties like server count and physical mem.

* Fixed comment

* Renaming get server cpu count

* Adding more detailed comment over here

* Making properties cpu count and physical memory to nullable<int> so they are defaulted to null.

* Fixing rest of the properties to nullable.
2021-08-09 17:24:04 -07:00
Aasim Khan
539e47b40f Adding cpu count and ram size to server info (#1220)
* adding network file validator contract

* Adding additional properties to serverInfo

* Renaming to serversysinfo

* fixing var name

* Changed to smo to get the properties

* Fixing casting error

* renaming to sysinfo

* Removing unused sql scripts

* Throwing an error and renaming classes

* Changing Physicalmemory prop name from kb to mb

* pushing prop name change

* fixing comment
2021-07-13 12:57:53 -07:00
Alex Ma
993b094db9 Localization added to sqlservicetools (#1216)
* added other languages to ServiceLayer

* fixed travis and appveyor yaml, added other languages for localization

* added spanish and german strings to credentialslocalization, also WIP for coreservices test

* added WIP localization test for CoreServices

* Removed unit test for coreservices, need to work on those later.

* restored travis and appveyor

* added kusto string resource localization test

* added localization test and locale change for SqlToolsCredentials

* added locale command options to ResourceProvider

* revert resourceprovider test

* Localized SqlTools.Credentials

* added hosting localization

* replaced new with translation to be consistent with main service layer

* reverted external changes as it is unnecessary

* Translated ManagedBatchParser

* test culture value

* test culture change

* temporarily comment out service layer command options

* returned sr.cs

* temporarily remove bad tests

* restored tests and allowed for SR culture to change for dependencies (for future testing)

* localization for resourceprovider components added.

* Set LocaleSetter to public and also removed InternalsVisible for Kusto, Credentials and ResourceProvider

* removed unnecessary changes

* Removed CredentialsCommandOptions

* renamed pt-BR to pt-br

* Rename sr.pt-BR.xlf.template to sr.pt-br.xlf.template

* Rename src/Microsoft.SqlTools.ServiceLayer/Localization/LCL/pt-BR/sr.resx.lcl to src/Microsoft.SqlTools.ServiceLayer/Localization/LCL/pt-br/sr.resx.lcl

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* Rename sr.pt-BR.xlf to sr.pt-br.xlf

* Rename sr.pt-BR.resx to sr.pt-br.resx

* restored newlines

* Update sr.pt-br.xlf.template

Removed newline

* removed newline

* fixing newlines for consistency

* removed unnecessary newline
2021-06-10 15:50:53 -07:00
Christopher Suh
2badd8e728 Fix Sql Auth for Migration Assessments (#1182)
* pass connection string to dma engine

* cleanup

* remove optional parameter

* modified query
2021-03-26 15:59:07 -07:00
Alex Ma
fefcab1c04 Added new String Resource Tool to fix issue (#1129) 2020-12-01 11:49:31 -08:00
BranislavGrbicMDCS
3e98a2f17b [brgrbic] SqlOD changes for cloud Server Type and minor bug fixes (#1092)
* The ServerType of SQL OD in SMO is being changed to cloud. This is a minimal set of changes needed in sqltoolservice in order to keep everything working within ADS.

* SMO version update
2020-10-23 18:48:33 +02:00
Charles Gagnon
d6ff73d510 Add fallback to query server property when getting BDC endpoints (#1083) 2020-09-28 09:19:21 -07:00
Alan Ren
b00e53c6b3 stop getting os version by parsing string (#1070)
* stop getting os version by parsing string

* ignore error
2020-09-09 11:06:59 -07:00
Monica Gupta
148b6e398d Added new Kusto ServiceLayer (#1009)
* Copy smoModel some rename

* Copy entire service layer

* Building copy

* Fixing some references

* Launch profile

* Resolve namespace issues

* Compiling tests. Correct manifest.

* Fixing localization resources

* ReliableKustoClient

* Some trimming of extra code and Kusto code

* Kusto client creation in bindingContent

* Removing Smo and new Kusto classes

* More trimming

* Kusto schema hookup

* Solidying DataSource abstraction

* Solidifying further

* Latest refatoring

* More refactoring

* Building and launching Kusto service layer

* Working model which enumerates databases

* Refactoring to pass IDataSource to all tree nodes

* Removing some dependencies on the context

* Working with tables and schema

* Comment checkin

* Refactoring to give out select script

* Query created and sent back to ADS

* Fix query generation

* Fix listing of databases

* Tunneling the query through.

* Successful query execution

* Return only results table

* Deleting Cms

* Delete DacFx

* Delete SchemaCompare and TaskServices

* Change build definition to not stop at launch

* Fix error after merge

* Save Kusto results in different formats (#935)

* save results as csv etc

* some fixes

Co-authored-by: Monica Gupta <mogupt@microsoft.com>

* 2407 Added OrderBy clause in KustoDataSource > GetDatabaseMetaData and GetColumnMetadata (#959)

* 2405 Defaulted Options when setting ServerInfo in ConnectionService > GetConnectionCompleteParams (#965)

* 2747 Fixed IsUnknownType error for Kusto (#989)

* 2747 Removed unused directives in Kusto > DbColumnWrapper. Refactored IsUnknownType to handle null DataTypeName

* 2747 Reverted IsUnknownType change in DbColumnWrapper. Changed DataTypeName to get calue from ColumnType. Refactored SafeGetValue to type check before hard casting to reduce case exceptions.

* Added EmbeddedResourceUseDependentUponConvention to Microsoft.Kusto.ServiceLayer.csproj. Also renamed DACfx to match Microsoft.SqlTools.ServiceLayer. Added to compile Exclude="**/obj/**/*.cs"

* Srahman cleanup sql code (#992)

* Removed Management and Security Service Code.

* Remove FileBrowser service

* Comment why we are using SqlServer library

* Remove SQL specific type definitions

* clean up formatter service (#996)

Co-authored-by: Monica Gupta <mogupt@microsoft.com>

* Code clean up and Kusto intellisense (#994)

* Code clean up and Kusto intellisense

* Addressed few comments

* Addressed few comments

* addressed comments

Co-authored-by: Monica Gupta <mogupt@microsoft.com>

* Return multiple tables for Kusto

* Changes required for Kusto manage dashboard (#1039)

* Changes required for manage dashboard

* Addressed comments

Co-authored-by: Monica Gupta <mogupt@microsoft.com>

* 2728 Kusto function support (#1038)

* loc update (#914)

* loc update

* loc updates

* 2728 moved ColumnInfo and KustoResultsReader to separate files. Added Folder and Function to TreeNode.cs

* 2728 Added FunctionInfo. Added Folder to ColumnInfo. Removed partial class from KustoResultsReader. Set Function.IsAlwaysLeaf=true in TreeNode.cs. In KustoDataSource changed tableMetadata type to TableMetaData. Added folder and function dictionaries. Refactored GetSchema function. Renamed GenerateColumnMetadataKey to GenerateMetadataKey

* 2728 Added FunctionInfo. Added Folder to ColumnInfo. Removed partial class from KustoResultsReader. Set Function.IsAlwaysLeaf=true in TreeNode.cs. In KustoDataSource changed tableMetadata type to TableMetaData. Added folder and function dictionaries. Refactored GetSchema function. Renamed GenerateColumnMetadataKey to GenerateMetadataKey

* 2728 Created new SqlConnection within using block. Refactored KustoDataSource > columnmetadata to sort on get instead of insert.

* 2728 Added GetFunctionInfo function to KustoDataSource.

* 2728 Reverted change to Microsoft.Kusto.ServiceLayer.csproj from merge

* 2728 Reverted change to SqlTools.ServiceLayer\Localization\transXliff

* 2728 Reverted change to sr.de.xlf and sr.zh-hans.xlf

* 2728 Refactored KustoDataSource Function folders to support subfolders

* 2728 Refactored KustoDataSource to use urn for folders, functions, and tables instead of name.

* Merge remote-tracking branch 'origin/main' into feature-ADE

# Conflicts:
#	Packages.props

* 2728 Moved metadata files into Metadata subdirectory. Added GenerateAlterFunction to IDataSource and DataSourceBase.

* 2728 Added summary information to SafeAdd in SystemExtensions. Renamed local variable in SetTableMetadata

* 2728 Moved SafeAdd from SystemExtensions to KustoQueryUtils. Added check when getting database schema to return existing records before querying again. Added AddRange function to KustoQueryUtils. Created SetFolderMetadataForFunctions method.

* 2728 Added DatabaseKeyPrefix to only return tables to a database for the dashboard. Added logic to store all database tables within the tableMetadata dictionary for the dashboard.

* 2728 Created TableInfo and moved info objects into Models directory. Refactored KustoDataSource to lazy load columns for tables. Refactored logic to load tables using cslschema instead of schema.

* 2728 Renamed LoadColumnSchema to GetTableSchema to be consistent.

Co-authored-by: khoiph1 <khoiph@microsoft.com>

* Addressed comments

Co-authored-by: Shafiq Rahman <srahman@microsoft.com>
Co-authored-by: Monica Gupta <mogupt@microsoft.com>
Co-authored-by: Justin M <63619224+JustinMDotNet@users.noreply.github.com>
Co-authored-by: rkselfhost <rkselfhost@outlook.com>
Co-authored-by: khoiph1 <khoiph@microsoft.com>
2020-08-12 15:34:38 -07:00
David Shiflet
839acf67cd Convert most tools service tests to nunit (#1037)
* 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
2020-08-05 13:43:14 -04:00
David Shiflet
79e81a69b2 Add an ADO yaml file for integration tests (#1035)
* enable code coverage for ADO test run

* fix debugtype default

* use file name instead of guid

* use wildcard for test dll name
2020-08-02 15:05:17 -04:00
Soheil Alizadeh
887a499d2b Update Infrastructure (#961)
* 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
2020-06-12 11:44:18 -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
Aditya Bist
005457813d fix build breaks (#924) 2020-02-26 12:35:26 -08:00
Udeesha Gautam
fe17962ac9 SqlCmd Connect/On Error/Include commands support (#898)
* Initial Investigation

* Working code with include, connect, on error and tests

* Adding some loc strings

* Some cleanup and more tests

* Some dummy change to trigger build

* Adding PR comments

* Addressing PR comments
2020-01-10 17:54:39 -08:00
Karl Burtram
427f0c11e8 Bump SMO and SqlClient to pickup Microsoft.Data.SqlClient fixes (#894)
* Revert "Revert to SMO with older SQLClient driver (#889)"

This reverts commit b763abae47.

* Bump SMO and SqlClient
2019-11-22 17:17:21 -08:00
Karl Burtram
b763abae47 Revert to SMO with older SQLClient driver (#889)
* 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
2019-11-04 13:00:45 -08:00
aleklj
84c505f647 Hotfix for ads dashboard for sqlondemand (#885)
* Hotfix for ads dashboard for sqlondemand

* Generalizing engine edition functions and adapting tests

* Minor comment and cosmetic fixes

* Adding SqlOnDemand server edition string
2019-10-31 17:35:11 +01:00
Udeesha Gautam
d75edd0dbe Revert "Explicitly erroring out on some failing commands that were not already included (#882)" (#887)
This reverts commit 57b7126ccf.
2019-10-30 14:51:41 -07:00
Udeesha Gautam
57b7126ccf Explicitly erroring out on some failing commands that were not already included (#882)
* Excplitly erroring out on some failing commands that was not happening before

* Ensuring the error message goes through without getting converted to different error
2019-10-25 15:41:59 -07:00
Charles Gagnon
f392a4a3f3 Remove BDC backwards compat check (#873)
* Remove BDC backwards compat check

* Fix merge issues
2019-10-04 14:13:32 -07:00
David Shiflet
9d140b53f3 Switch Tools Service to new SMO and Microsoft.Data.SqlClient driver (#865)
* 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
2019-09-17 17:51:19 -04:00
Kevin Cunnane
2b617dc114 Use new DMV for big data cluster check (#849)
* Use new DMV for big data cluster check
* Include fallback logic to use older CTP cluster table if new DMV does not exist
2019-08-14 10:54:34 -07:00
Udeesha Gautam
68145d5e7c Feature/sqlcmd : Enable running scripts with SQLCMD variables - Part 1 (#839)
* Part1 : Changes to make cmdcmd script to work with parameters in script

* Stop SQL intellisense for SQLCMD

* Adding test for Intellisense handling of SQLCMD page

* Removing unintentional spacing changes caused by formatting

* Updating with smaller CR comments. Will discuss regarding script vs other options in batch info

* Removing unintentional change

* Adding latest PR comments
2019-08-09 14:25:47 -07:00
NiranjanVirtuosity
2e2b764c6d Invoke-SqlCmd handles ":!!if" in inconsistent way (PS5 vs PS6) (#806)
* Invoke-SqlCmd handles ":!!if" in inconsistent way (PS5 vs PS6)

Fix: Set wordBounday to false for "!!" in Lexer.cs

* Issue : Invoke-SqlCmd handles ":!!if" in inconsistent way (PS5 vs PS6)
TFS: http://sqlbuvsts01:8080/Main/SQL%20Server/_workitems#id=12817630&triage=true&_a=edit
Fix:
1) Wrote two test cases in BatchParserTests.cs
2019-05-13 15:09:21 -07:00
Aditya Bist
eb2044155b Fix Dashboard OS version script (#804)
* fix OS version script

* lower everything to find keyword

* add check to another file
2019-05-03 16:20:19 -07:00
Dhruva N
e9bf57bc67 Include ManagedBatchParser tests to improve code coverage (#793)
* Include ManagedBatchParser test to improve code coverage

* Fix some failing test cases and revert appveyor.yml
2019-04-22 17:35:48 -07: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
Karl Burtram
022282800a Move managed parser into its own project (test code coverage) (#774)
* Created New ManagedBatchParser project in .NetStandard

* Addressing PR Comments

* Resolve 'No Repository' warning.

* Move batch parser tests to integrations test project

* Fix SLN file
2019-02-07 20:13:03 -08:00