Skip to content

.Net: [MEVD] Implement store key generation where supported #11485

@roji

Description

@roji

Our upsert APIs allow returning keys/IDs which are generated in the vector store, but we don't actually implement that for connectors yet. We're also lacking a way for users to indicate that they want

  • Add IsAutoGenerated flag on VectorStoreRecordKeyProperty.
    • For the attribute, we could add it, or there's the .NET [DatabaseGenerated(DatabaseGeneratedOption.Identity)] (EF recognizes this, so do some other layers). Though the naming (identity) isn't ideal (it's SQL Server-specific).
  • Open design question: when a key property is configured as auto-generated, is it still possible for users to provide a value?
    • This opens up the question of how we determine whether the user has set the value or not. For this case, EF checks if the key property has the default value, and assumes it's "unset" if so; this works relatively well, as relational databases typically start from 1 for numbers, empty GUIDs (all-zeros) are also a useful sentinel value, etc.
    • But we can always start by not supporting this and add it later (i.e. if a key property is configured as auto-generated, it cannot be set).

See previous conversation in #10692.

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codemsft.ext.vectordataRelated to Microsoft.Extensions.VectorData

Projects

Status

Sprint: Done

Relationships

None yet

Development

No branches or pull requests

Issue actions