Skip to content

Commit

Permalink
Suppport latest version of Microsoft.Data.SqlClient (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
z1c0 authored Feb 23, 2023
1 parent 4ce08b5 commit a3f1d60
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 30 deletions.
4 changes: 2 additions & 2 deletions docs/integrations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
|{nuget}/System.Data.SqlClient[System.Data.SqlClient 4.0.0 - 4.{star}.{star}]
|System.Data.SqlClient 4.0.0 - 4.{star}.{star}

|{nuget}/Microsoft.Data.SqlClient[Microsoft.Data.SqlClient 1.0.0 - 2.{star}.{star}]
|Microsoft.Data.SqlClient 1.0.0 - 2.{star}.{star}
|{nuget}/Microsoft.Data.SqlClient[Microsoft.Data.SqlClient 1.0.0 - 5.{star}.{star}]
|Microsoft.Data.SqlClient 1.0.0 - 5.{star}.{star}

.2+.^|SqliteCommand
|{nuget}/Microsoft.Data.Sqlite[Microsoft.Data.Sqlite 2.0.0 - 7.{star}.{star}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public InstrumentMicrosoftDataSqlClientAttribute()
Assembly = "Microsoft.Data.SqlClient";
Type = "Microsoft.Data.SqlClient.SqlCommand";
MinimumVersion = "1.0.0";
MaximumVersion = "2.*.*";
MaximumVersion = "5.*.*";
Group = "SqlCommand";
}
}
Expand Down
24 changes: 12 additions & 12 deletions src/Elastic.Apm.Profiler.Managed/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@
- System.Threading.Tasks.Task`1<System.Int32>
- System.Threading.CancellationToken
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteNonQueryAsyncIntegration
Expand Down Expand Up @@ -943,7 +943,7 @@
signature_types:
- System.Int32
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteNonQueryIntegration
Expand Down Expand Up @@ -982,7 +982,7 @@
- System.Int32
- System.Data.CommandBehavior
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteNonQueryWithBehaviorIntegration
Expand Down Expand Up @@ -1021,7 +1021,7 @@
- System.Threading.Tasks.Task`1<Microsoft.Data.SqlClient.SqlDataReader>
- System.Threading.CancellationToken
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteReaderAsyncIntegration
Expand Down Expand Up @@ -1057,7 +1057,7 @@
signature_types:
- Microsoft.Data.SqlClient.SqlDataReader
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteReaderIntegration
Expand Down Expand Up @@ -1099,7 +1099,7 @@
- System.Data.CommandBehavior
- System.Threading.CancellationToken
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteReaderWithBehaviorAsyncIntegration
Expand Down Expand Up @@ -1141,7 +1141,7 @@
- System.Data.CommandBehavior
- System.Threading.CancellationToken
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteReaderWithBehaviorAsyncIntegration
Expand Down Expand Up @@ -1180,7 +1180,7 @@
- Microsoft.Data.SqlClient.SqlDataReader
- System.Data.CommandBehavior
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteReaderWithBehaviorIntegration
Expand Down Expand Up @@ -1219,7 +1219,7 @@
- System.Data.Common.DbDataReader
- System.Data.CommandBehavior
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteReaderWithBehaviorIntegration
Expand Down Expand Up @@ -1258,7 +1258,7 @@
- System.Threading.Tasks.Task`1<System.Object>
- System.Threading.CancellationToken
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteScalarAsyncIntegration
Expand Down Expand Up @@ -1294,7 +1294,7 @@
signature_types:
- System.Object
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteScalarIntegration
Expand Down Expand Up @@ -1333,7 +1333,7 @@
- System.Object
- System.Data.CommandBehavior
minimum_version: 1.0.0
maximum_version: 2.*.*
maximum_version: 5.*.*
wrapper:
assembly: Elastic.Apm.Profiler.Managed, Version=1.20.0.0, Culture=neutral, PublicKeyToken=ae7400d2c189cf22
type: Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteScalarWithBehaviorIntegration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>net461;netcoreapp3.1;net5.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RootNamespace>Elastic.Apm.SqlClient.Tests</RootNamespace>
<AssemblyName>Elastic.Apm.SqlClient.Tests</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.6.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="1.1.4" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
<PackageReference Include="Testcontainers" Version="2.3.0" />
Expand All @@ -25,7 +18,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.32" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

Expand Down
6 changes: 1 addition & 5 deletions test/Elastic.Apm.SqlClient.Tests/SqlServerFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public SqlServerFixture()
public async Task InitializeAsync()
{
await _container.StartAsync();
ConnectionString = _container.ConnectionString;
ConnectionString = _container.ConnectionString + ";TrustServerCertificate=True";
}

public async Task DisposeAsync()
Expand All @@ -46,11 +46,7 @@ ValueTask IAsyncDisposable.DisposeAsync()
{
if (_container != null)
return _container.DisposeAsync();
#if NET5_0_OR_GREATER
return ValueTask.CompletedTask;
#else
return default;
#endif
}
}
}

0 comments on commit a3f1d60

Please sign in to comment.