Zaid-Ajaj/Npgsql.FSharp

pgvector support

Opened this issue · 2 comments

Is there anything planned already? Otherwise I could come up with something, as we need it anyway for our project.

I would probably have a look at https://github.com/pgvector/pgvector-dotnet or even add it as a dependency if that would be ok.

There is nothing planned for this. It is not already possible to use this without taking a dependency on the library? Because looking at the docs:

var dataSourceBuilder = new NpgsqlDataSourceBuilder(connString);
dataSourceBuilder.UseVector();
await using var dataSource = dataSourceBuilder.Build();

var conn = dataSource.OpenConnection();

Since it gives you a NpgsqlConnection , you can use that from this library with

conn
|> Sql.existingConnection

Specialized input parameters can be implemented with Sql.parameter customParameter and reading rows should be possible because the Sql.execute and friends give you access to the underlying NgpsqlReader

@Zaid-Ajaj Yes, it's definitely possible. I was just curious if it is something you are interested in having "first-class support" for. If not, then your answer will probably be sufficient for anyone looking to use pgvector with Npgsql.FSharp. 👍