Skip to content
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
12 changes: 12 additions & 0 deletions Frends.MicrosoftSQL.BatchOperation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# Changelog

## [2.2.0] - 2026-01-22

### Changed

- Improve execution of async methods.

## [2.1.0] - 2024-08-26

### Changed

- Updated Newtonsoft.Json to the latest version 13.0.3.

## [2.0.0] - 2024-08-05

### Changed

- [Breaking] The task now uses Microsoft.Data.SqlClient instead of System.Data.SqlClient.

## [1.0.0] - 2023-02-03

### Added

- Initial implementation
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ public static async Task<Result> BatchOperation([PropertyTab] Input input, [Prop
try
{
using var connection = new SqlConnection(input.ConnectionString);
await connection.OpenAsync(cancellationToken);
await connection.OpenAsync(cancellationToken).ConfigureAwait(false);
if (options.SqlTransactionIsolationLevel is not SqlTransactionIsolationLevel.None)
{
using var transaction = connection.BeginTransaction(GetIsolationLevel(options));
return await ExecuteHandler(input, options, connection, transaction, cancellationToken);
return await ExecuteHandler(input, options, connection, transaction, cancellationToken).ConfigureAwait(false);
}
else
return await ExecuteHandler(input, options, connection, null, cancellationToken);
return await ExecuteHandler(input, options, connection, null, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
Expand Down Expand Up @@ -80,7 +80,7 @@ private static async Task<Result> ExecuteHandler(Input input, Options options, S
.ConfigureAwait(false);

if (transaction != null)
await transaction.CommitAsync(cancellationToken);
await transaction.CommitAsync(cancellationToken).ConfigureAwait(false);

return new Result(true, affectedRows, null);
}
Expand All @@ -97,7 +97,7 @@ private static async Task<Result> ExecuteHandler(Input input, Options options, S
{
try
{
await transaction.RollbackAsync(cancellationToken);
await transaction.RollbackAsync(cancellationToken).ConfigureAwait(false);
}
catch (Exception rollbackEx)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>2.1.0</Version>
<TargetFramework>net6.0</TargetFramework>
<Version>2.2.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand Down
25 changes: 23 additions & 2 deletions Frends.MicrosoftSQL.BulkInsert/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,47 @@
# Changelog

## [3.1.0] - 2026-01-22

### Changed

- Improve execution of async methods.

## [3.0.0] - 2025-01-15

### Added

- [Breaking] Added parameters ColumnMapping and ManualColumnMapping.
- Added column mapping feature which allows user to select from JsonPropertyNames, JsonPropertyOrder and ManualColumnMapping options how the column mapping is handled in bulk insert. Default behavior will remain the same JsonPropertyOrder.
- Added column mapping feature which allows user to select from JsonPropertyNames, JsonPropertyOrder and
ManualColumnMapping options how the column mapping is handled in bulk insert. Default behavior will remain the same
JsonPropertyOrder.

## [2.2.0] - 2024-09-10

### Changed
- Updated Options.NotifyAfter property to be set dynamically based on the total row count, with a minimum value of 1, ensuring rowsCopied is updated correctly.

- Updated Options.NotifyAfter property to be set dynamically based on the total row count, with a minimum value of 1,
ensuring rowsCopied is updated correctly.

## [2.1.0] - 2024-08-26

### Changed

- Updated Newtonsoft.Json to the latest version 13.0.3.

## [2.0.0] - 2024-08-05

### Changed

- [Breaking] The task now uses Microsoft.Data.SqlClient instead of System.Data.SqlClient.

## [1.1.0] - 2023-01-26

### Added

- Options.ThrowErrorOnFailure and Result.ErrorMessage was added to let the user choose how to handle errors.

## [1.0.0] - 2023-01-10

### Added

- Initial implementation
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static async Task<Result> BulkInsert([PropertyTab] Input input, [Property
{
try
{
var result = await ExecuteHandler(options, input, dataSet, new SqlBulkCopy(connection, GetSqlBulkCopyOptions(options), null), cancellationToken);
var result = await ExecuteHandler(options, input, dataSet, new SqlBulkCopy(connection, GetSqlBulkCopyOptions(options), null), cancellationToken).ConfigureAwait(false);
return new Result(true, result, null);
}
catch (Exception ex)
Expand All @@ -64,15 +64,15 @@ public static async Task<Result> BulkInsert([PropertyTab] Input input, [Property

try
{
var result = await ExecuteHandler(options, input, dataSet, new SqlBulkCopy(connection, GetSqlBulkCopyOptions(options), transaction), cancellationToken);
await transaction.CommitAsync(cancellationToken);
var result = await ExecuteHandler(options, input, dataSet, new SqlBulkCopy(connection, GetSqlBulkCopyOptions(options), transaction), cancellationToken).ConfigureAwait(false);
await transaction.CommitAsync(cancellationToken).ConfigureAwait(false);
return new Result(true, result, null);
}
catch (Exception ex)
{
try
{
await transaction.RollbackAsync(cancellationToken);
await transaction.RollbackAsync(cancellationToken).ConfigureAwait(false);
}
catch (Exception rollbackEx)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>3.0.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
<Product>Frends</Product>
<PackageTags>Frends</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>Frends Task to execute bulk insert JSON data to Microsoft SQL Server.</Description>
<PackageProjectUrl>https://frends.com/</PackageProjectUrl>
<RepositoryUrl>https://github.com/FrendsPlatform/Frends.MicrosoftSQL</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<None Include="FrendsTaskMetadata.json" Pack="true" PackagePath="/">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>3.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
<Product>Frends</Product>
<PackageTags>Frends</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>Frends Task to execute bulk insert JSON data to Microsoft SQL Server.</Description>
<PackageProjectUrl>https://frends.com/</PackageProjectUrl>
<RepositoryUrl>https://github.com/FrendsPlatform/Frends.MicrosoftSQL</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<None Include="FrendsTaskMetadata.json" Pack="true" PackagePath="/">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions Frends.MicrosoftSQL.ExecuteProcedure/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,54 @@
# Changelog

## [2.3.0] - 2026-01-22

### Changed

- Improve execution of async methods.

## [2.2.0] - 2024-12-16

- Added method to form JToken from the SqlDataReader so that SqlGeography and SqlGeometry typed objects can be handled.
- Fixed how Scalar handles the data so that SqlGeography and SqlGeometry typed objects can be handled.
- Added Microsoft.SqlServer.Types version 160.1000.6 as dependency.

## [2.1.0] - 2024-08-26

### Changed

- Updated Newtonsoft.Json to the latest version 13.0.3.

## [2.0.0] - 2024-08-05

### Changed

- [Breaking] The task now uses Microsoft.Data.SqlClient instead of System.Data.SqlClient.

## [1.2.1] - 2024-02-12

### Fixed

- Fixed issue with null parameters by changing them into DBNull.Value.

### Updated

- System.Data.SqlClient to version 4.8.6.

## [1.2.0] - 2024-01-03

### Changed

- [Breaking] ProcedureParameter.Value type to object so that binary data can be used.

## [1.0.1] - 2023-08-03

### Changed

- Documentation update to Input.Execute parameter.
- Removed unnecessary runtime unloader.

## [1.0.0] - 2023-01-23

### Added

- Initial implementation
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static async Task<Result> ExecuteProcedure([PropertyTab] Input input, [Pr
using var connection = new SqlConnection(input.ConnectionString);
try
{
await connection.OpenAsync(cancellationToken);
await connection.OpenAsync(cancellationToken).ConfigureAwait(false);

using var command = connection.CreateCommand();
command.CommandTimeout = options.CommandTimeoutSeconds;
Expand All @@ -58,12 +58,12 @@ public static async Task<Result> ExecuteProcedure([PropertyTab] Input input, [Pr
}

if (options.SqlTransactionIsolationLevel is SqlTransactionIsolationLevel.None)
result = await ExecuteHandler(input, options, command, cancellationToken);
result = await ExecuteHandler(input, options, command, cancellationToken).ConfigureAwait(false);
else
{
using var transaction = connection.BeginTransaction(GetIsolationLevel(options.SqlTransactionIsolationLevel));
command.Transaction = transaction;
result = await ExecuteHandler(input, options, command, cancellationToken);
result = await ExecuteHandler(input, options, command, cancellationToken).ConfigureAwait(false);
}

return result;
Expand Down Expand Up @@ -104,22 +104,22 @@ private static async Task<Result> ExecuteHandler(Input input, Options options, S
break;
case ExecuteTypes.ExecuteReader:
dataReader = await command.ExecuteReaderAsync(cancellationToken).ConfigureAwait(false);
result = new Result(true, dataReader.RecordsAffected, null, await LoadData(dataReader, cancellationToken));
await dataReader.CloseAsync();
result = new Result(true, dataReader.RecordsAffected, null, await LoadData(dataReader, cancellationToken).ConfigureAwait(false));
await dataReader.CloseAsync().ConfigureAwait(false);
break;
default:
throw new NotSupportedException();
}

if (command.Transaction != null)
await command.Transaction.CommitAsync(cancellationToken);
await command.Transaction.CommitAsync(cancellationToken).ConfigureAwait(false);

return result;
}
catch (Exception ex)
{
if (dataReader != null && !dataReader.IsClosed)
await dataReader.CloseAsync();
await dataReader.CloseAsync().ConfigureAwait(false);

return HandleExecutionException(ex, options, command);
}
Expand All @@ -130,7 +130,7 @@ private static async Task<JToken> LoadData(SqlDataReader reader, CancellationTok
var table = new JArray();
while (reader.HasRows)
{
while (await reader.ReadAsync(cancellationToken))
while (await reader.ReadAsync(cancellationToken).ConfigureAwait(false))
{
var row = new JObject();
for (var i = 0; i < reader.FieldCount; i++)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>2.2.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
<Product>Frends</Product>
<PackageTags>Frends</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>Frends Task to execute Microsoft SQL Server procedure.</Description>
<PackageProjectUrl>https://frends.com/</PackageProjectUrl>
<RepositoryUrl>https://github.com/FrendsPlatform/Frends.MicrosoftSQL</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<None Include="FrendsTaskMetadata.json" Pack="true" PackagePath="/">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="160.1000.6" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>2.3.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
<Product>Frends</Product>
<PackageTags>Frends</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>Frends Task to execute Microsoft SQL Server procedure.</Description>
<PackageProjectUrl>https://frends.com/</PackageProjectUrl>
<RepositoryUrl>https://github.com/FrendsPlatform/Frends.MicrosoftSQL</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<None Include="FrendsTaskMetadata.json" Pack="true" PackagePath="/">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageReference Include="Microsoft.SqlServer.Types" Version="160.1000.6"/>
</ItemGroup>
</Project>
Loading
Loading