Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExecuteQueryToFile - add managed identity authentication #51

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Frends.MicrosoftSQL.ExecuteQueryToFile/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [2.0.0] - 2024-08-05
### Changed
- [Breaking] The task now uses Microsoft.Data.SqlClient instead of System.Data.SqlClient.

## [1.0.1] - 2024-02-12
### Fixed
- Fixed handling of null query parameters by changing the parameter value to DBNull.Value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ namespace Frends.MicrosoftSQL.ExecuteQueryToFile.Tests;

using System;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Threading.Tasks;
using Frends.MicrosoftSQL.ExecuteQueryToFile.Definitions;
using Frends.MicrosoftSQL.ExecuteQueryToFile.Enums;
using Microsoft.Data.SqlClient;
using NUnit.Framework;

/// <summary>
Expand Down Expand Up @@ -55,13 +55,13 @@ public void Init()

Helper.CreateTestTable(_connString, _tableName);

var parameters = new System.Data.SqlClient.SqlParameter[]
var parameters = new Microsoft.Data.SqlClient.SqlParameter[]
{
new System.Data.SqlClient.SqlParameter("@Hash", SqlDbType.VarBinary)
new Microsoft.Data.SqlClient.SqlParameter("@Hash", SqlDbType.VarBinary)
{
Value = File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(_destination), "Test_image.png")),
},
new System.Data.SqlClient.SqlParameter("@TestText", SqlDbType.VarBinary)
new Microsoft.Data.SqlClient.SqlParameter("@TestText", SqlDbType.VarBinary)
{
Value = File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(_destination), "Test_text.txt")),
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
namespace Frends.MicrosoftSQL.ExecuteQueryToFile.Tests;

using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

internal static class Helper
{
internal static string GetConnectionString()
{
var user = "SA";
var pwd = "Salakala123!";
return $"Server=127.0.0.1,1433;Database=Master;User Id={user};Password={pwd}";
return $"Server=127.0.0.1,1433;Database=Master;User Id={user};Password={pwd};TrustServerCertificate=True";
}

internal static void CreateTestTable(string connString, string tableName)
Expand All @@ -22,7 +22,7 @@ internal static void CreateTestTable(string connString, string tableName)
connection.Close();
}

internal static void InsertTestData(string connString, string commandText, System.Data.SqlClient.SqlParameter[] parameters = null)
internal static void InsertTestData(string connString, string commandText, Microsoft.Data.SqlClient.SqlParameter[] parameters = null)
{
using var sqlConnection = new SqlConnection(connString);
sqlConnection.Open();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlClient;
using System.Globalization;
using System.IO;
using System.Linq;
Expand All @@ -12,6 +11,7 @@
using CsvHelper;
using CsvHelper.Configuration;
using Frends.MicrosoftSQL.ExecuteQueryToFile.Enums;
using Microsoft.Data.SqlClient;

namespace Frends.MicrosoftSQL.ExecuteQueryToFile.Definitions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Threading;
using System.Threading.Tasks;
using Frends.MicrosoftSQL.ExecuteQueryToFile.Definitions;
using Frends.MicrosoftSQL.ExecuteQueryToFile.Enums;
using Microsoft.Data.SqlClient;

/// <summary>
/// Main class of the Task.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>Latest</LangVersion>
<Version>1.0.1</Version>
<Version>2.0.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand All @@ -30,10 +30,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="CsvHelper" Version="30.0.1" />
</ItemGroup>

Expand Down
Loading