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
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.51.0" />

<!-- SQL Server dependencies -->
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.0-preview2.25178.5" />
<PackageVersion Include="Microsoft.SqlServer.Types" Version="170.700.9-ctp2p0" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.0" />
<PackageVersion Include="Microsoft.SqlServer.Types" Version="160.1000.6" />

<!-- external dependencies -->
<PackageVersion Include="Castle.Core" Version="5.2.1" />
Expand Down
1 change: 0 additions & 1 deletion src/EFCore.SqlServer/EFCore.SqlServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" />
<PackageReference Include="Microsoft.SqlServer.Types" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this in #36383 under the mistaken impression that the new SqlVector type lives in Microsoft.SqlServer.Types, but it seems to be in Microsoft.Data.SqlClient - so reverting.

</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ private sealed class VectorComparer() : ValueComparer<SqlVector<float>>(
// This is because vectors are basically immutable, and it's better to have more efficient change tracking
// equality checks.
private static bool CalculateEquality(SqlVector<float>? x, SqlVector<float>? y)
=> x is null
? y is null
: y is not null && (x.IsNull
? y.IsNull
: !y.IsNull && x.Memory.Span == y.Memory.Span);
=> x is SqlVector<float> v1 && y is SqlVector<float> v2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that SqlVector was changed to be a readonly struct in the GA version of SqlClient.

? v1.IsNull
? v2.IsNull
: !v2.IsNull && v1.Memory.Span == v2.Memory.Span
: x is null && y is null;

private static int CalculateHashCode(SqlVector<float> vector)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class VectorEntity
public int Id { get; set; }

[Column(TypeName = "vector(3)")]
public SqlVector<float> Vector { get; set; } = null!;
public SqlVector<float> Vector { get; set; }
}

public class VectorQueryFixture : SharedStoreFixtureBase<VectorQueryContext>
Expand Down