Skip to content

Port to Npgsql 8.0.0-rc.2 - #21

Merged
ankane merged 1 commit into
pgvector:masterfrom
roji:Npgsql8Rc2
Oct 12, 2023
Merged

ankane merged 1 commit into
pgvector:masterfrom
roji:Npgsql8Rc2

Conversation

@roji

@roji roji commented Oct 11, 2023 •

Copy link
Copy Markdown
Contributor

@ankane here's a PR porting pgvector-dotnet to run against 8.0.0-rc.2 versions of Npgsql and the EF provider, which were released today.

We are building some experiments/demos which would greatly benefit from this; so if possible, a prerelease nuget package for this would be greatly appreciated!

@bricelam

Copy link
Copy Markdown

The npgsql8-v2 branch is a bit behind master, but it looks like these changes will still merge cleanly.

@ankane

ankane commented Oct 11, 2023

Copy link
Copy Markdown
Member

Hi @roji, thanks for the PR. I don't plan to do more work for Npgsql 8 until the final release, so will revisit this then.

@roji

roji commented Oct 11, 2023 •

Copy link
Copy Markdown
Contributor Author

@ankane are you saying you won't be publishing an 8.0 prerelease package? As I wrote above, we're working on some demos to show off pgvector which depend on 8.0; if no version will be available we'll likely need to switch to another vector database (which would be a shame, PG+pgvector is a great combination for what we have in mind).

Just FYI I'll be happy to take on any work needed to make this happen.

@ankane

ankane commented Oct 11, 2023

Copy link
Copy Markdown
Member

I typically don't do pre-release versions, but will make an exception. Can you use master as the target branch (for this and any other PRs for 0.2.0-rc.1)? Also, please make sure VectorTypeInfoResolver.cs has a trailing newline like the other files.

@davidfowl

Copy link
Copy Markdown

We really appreciate it @ankane !!

@roji

roji commented Oct 12, 2023

Copy link
Copy Markdown
Contributor Author

@ankane thanks, will do!

@roji
roji changed the base branch from npgsql8-v2 to master October 12, 2023 15:09
@roji

roji commented Oct 12, 2023

Copy link
Copy Markdown
Contributor Author

@ankane rebase on top of master.

@ankane

ankane commented Oct 12, 2023

Copy link
Copy Markdown
Member

Thanks, will try to get this merged later tonight. A few questions:

  1. What's the reason for the TODO (making arrays opt-in)?
  2. Any other functionality (besides Change namespace for entry-point extension methods #19) that should be in included in the release candidate? (can also wait a bit if that's better)
  3. Unrelated: Is there a way to set Postgres storage parameters for indexes in EF Core? (needed for lists with ivfflat and m and ef_construction for hnsw)

@roji

roji commented Oct 12, 2023

Copy link
Copy Markdown
Contributor Author

What's the reason for the TODO (making arrays opt-in)?

This is something we also currently have in Npgsql-bundled plugins - there's some last pending work for 8.0. This isn't critical - it's about in general allowing the user to not opt into Npgsql array support, in order to reduce binary size when building with NativeAOT (NativeAOT support is a big feature being delivered for 8.0, and is the primary reason for the plugin API changes in the first place).

Bottom line, this isn't really important - we can very well ship with this TODO; the only effect would be a tiny bit bigger binary for users who don't use PG arrays.

Any other functionality (besides #19) that should be in included in the release candidate? (can also wait a bit if that's better)

There are some changes I'd recommend around the Vector type:

  • Rename from Vector to PgVector to avoid ambiguity with e.g. .NET Vector
  • Make it into a readonly struct as we discussed before

I'm happy to do a PR for these as well, if you're OK with them. But otherwise there's nothing I'm aware of.

Unrelated: Is there a way to set Postgres storage parameters for indexes in EF Core? (needed for lists with ivfflat and m and ef_construction for hnsw)

No, not at the moment - there's support for storage parameters for tables, but not for indexes. If this is important I can add this to the provider 8.0 - let me know.

@ankane
ankane merged commit 6903d8f into pgvector:master Oct 12, 2023
@ankane

ankane commented Oct 12, 2023

Copy link
Copy Markdown
Member

Thanks for the additional context on arrays.

One other change we discussed was equality (if you want to submit a PR - otherwise, I can take a look at it).

Storage parameters for indexes would be great for users (setting lists is very important for ivfflat, and it'd be nice to be able to set the others for hnsw when the defaults don't work well).

@roji

roji commented Oct 13, 2023

Copy link
Copy Markdown
Contributor Author

One other change we discussed was equality (if you want to submit a PR - otherwise, I can take a look at it).

Submitted #22, let's discuss there.

Storage parameters for indexes would be great for users (setting lists is very important for ivfflat, and it'd be nice to be able to set the others for hnsw when the defaults don't work well).

Opened npgsql/efcore.pg#2899 to track, will give this priority for 8.0.

@ankane

ankane commented Oct 13, 2023

Copy link
Copy Markdown
Member

Great, thanks @roji

@ankane

ankane commented Oct 14, 2023

Copy link
Copy Markdown
Member

Just published 0.2.0-rc.1 for both Pgvector and Pgvector.EntityFrameworkCore. Let me know if anything else comes up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants