Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 2 additions & 1 deletion dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<PackageVersion Include="Docker.DotNet" Version="3.125.15" />
<!-- Plugins -->
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.3.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="10.0.0-preview.3.25171.6" />
<PackageVersion Include="DuckDB.NET.Data.Full" Version="1.2.0" />
<PackageVersion Include="DuckDB.NET.Data" Version="1.1.3" />
<PackageVersion Include="MongoDB.Driver" Version="2.30.0" />
Expand All @@ -154,6 +154,7 @@
<!-- Memory stores -->
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.48.0-preview.0" />
<PackageVersion Include="Pgvector" Version="0.3.1" />
<PackageVersion Include="sqlite-vec" Version="0.1.7-alpha.2" />
<PackageVersion Include="NRedisStack" Version="0.12.0" />
<PackageVersion Include="Milvus.Client" Version="2.3.0-preview.1" />
<PackageVersion Include="Testcontainers" Version="4.4.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFrameworks>net8.0;netstandard2.0;net462</TargetFrameworks>
<VersionSuffix>preview</VersionSuffix>
<NoWarn>$(NoWarn);CS1591</NoWarn> <!-- A temporary workaround for https://github.com/jeffhandley/sqlite-dist/pull/1 -->
</PropertyGroup>

<!-- IMPORT NUGET PACKAGE SHARED PROPERTIES -->
Expand All @@ -27,6 +28,7 @@
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" />
<PackageReference Include="Microsoft.Data.Sqlite" />
<PackageReference Include="System.Numerics.Tensors" />
<PackageReference Include="sqlite-vec" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ namespace SqliteVecIntegrationTests.Support;

internal static class SqliteTestEnvironment
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've not removed this class because I was not able to test it on Full Framework because I can't even load the sqlite itself on Full Framework (not the extension):

System.TypeInitializationException : The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception.
---- System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
-------- System.Exception : Library e_sqlite3 not found
plat: win
suffix: DLL
possibilities (3):
    1) C:\Users\adsitnik\AppData\Local\Temp\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\assembly\dl3\909e6049\001ea6ec_8604db01\runtimes\win-x64\native\e_sqlite3.dll
    2) C:\Users\adsitnik\AppData\Local\Temp\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\assembly\dl3\909e6049\001ea6ec_8604db01\e_sqlite3.dll
    3) D:/projects/forks/semantic-kernel/dotnet/src/VectorDataIntegrationTests/SqliteVecIntegrationTests/bin/Debug/net472/e_sqlite3.dll
win TryLoad: C:\Users\adsitnik\AppData\Local\Temp\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\assembly\dl3\909e6049\001ea6ec_8604db01\runtimes\win-x64\native\e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
   at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action`1 log, IntPtr& h)
win TryLoad: C:\Users\adsitnik\AppData\Local\Temp\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\assembly\dl3\909e6049\001ea6ec_8604db01\e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
   at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action`1 log, IntPtr& h)
win TryLoad: D:/projects/forks/semantic-kernel/dotnet/src/VectorDataIntegrationTests/SqliteVecIntegrationTests/bin/Debug/net472/e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
   at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action`1 log, IntPtr& h)
NOT FOUND


  Stack Trace: 
SqliteConnection.ctor(String connectionString)
<GetNonExistingCollectionAsync>d__9`1.MoveNext() line 152
<GetConnectionAsync>d__27.MoveNext() line 540
--- End of stack trace from previous location where exception was thrown ---
ExceptionDispatchInfo.Throw()
TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
ValueTask`1.get_Result()
<DeleteCollectionAsync>d__15.MoveNext() line 138
--- End of stack trace from previous location where exception was thrown ---
ExceptionDispatchInfo.Throw()
<17 more frames...>
----- Inner Stack Trace -----
RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
MethodBase.Invoke(Object obj, Object[] parameters)
SqliteConnection.cctor()
----- Inner Stack Trace -----
NativeLibrary.Load(String libraryName, Assembly assy, Int32 flags)
Batteries_V2.MakeDynamic(String name, Int32 flags)
Batteries_V2.DoDynamic_cdecl(String name, Int32 flags)

Copy link
Member

Choose a reason for hiding this comment

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

Huh... OK...

I'm hoping this is somehow related to the test environment/xunit... Can I ask you to do a quick test from a full framework console program, with Microsoft.Data.Sqlite and the new nuget package, to make sure it actually works for users? Otherwise we might have an actual issue here (we specifically worked on making the nuget on full framework, but I no longer remember the exact details...)

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've reported the bug: dotnet/efcore#36069

{
/// <summary>
/// SQLite extension name for vector search.
/// More information here: <see href="https://github.com/asg017/sqlite-vec"/>.
/// </summary>
private const string VectorSearchExtensionName = "vec0";

private static bool? s_isSqliteVecInstalled;

internal static bool TryLoadSqliteVec(SqliteConnection connection)
Expand All @@ -26,7 +20,7 @@ internal static bool TryLoadSqliteVec(SqliteConnection connection)

try
{
connection.LoadExtension(VectorSearchExtensionName);
connection.LoadVector();
s_isSqliteVecInstalled = true;
}
catch (SqliteException)
Expand Down
Loading