Setup pgvector with Visual Basic
masterFor Visual Basic users, install the Pgvector package. Configure the NpgsqlDataSourceBuilder with .UseVector() and ensure you call conn.ReloadTypes() after creating the extension.
dotnet add package PgvectorDim dataSourceBuilder As New NpgsqlDataSourceBuilder(connString)
dataSourceBuilder.UseVector()
Dim dataSource = dataSourceBuilder.Build()
Dim conn = dataSource.OpenConnection()
' Enable extension
Using cmd As New NpgsqlCommand("CREATE EXTENSION IF NOT EXISTS vector", conn)
cmd.ExecuteNonQuery()
End Using
conn.ReloadTypes()