-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codeBuildFeatures planned for next Build conferenceFeatures planned for next Build conferencebugSomething isn't workingSomething isn't workingmsft.ext.vectordataRelated to Microsoft.Extensions.VectorDataRelated to Microsoft.Extensions.VectorData
Description
Some input validation is missing, leading to syntax errors in the SQL generated.
Syntax errors could be avoided using named parameters (e.g. "@paramname").
This specific error could be avoided validating the model definition and informing the user with a specific validation exception. For instance, here the vector column is missing:
var def = new VectorStoreRecordDefinition
{
Properties = new List<VectorStoreRecordProperty>
{
new VectorStoreRecordKeyProperty("Id", typeof(string)),
new VectorStoreRecordDataProperty("Count", typeof(long))
}
};
var collection = db.GetCollection<string, VectorStoreGenericDataModel<string>>("tests", def);
await collection.CreateCollectionAsync().ConfigureAwait(false);
var record = new VectorStoreGenericDataModel<string>("1");
record.Vectors["Count"] = 123;
await collection.UpsertAsync(record);leading to this generic/proprietary exception:
Microsoft.Extensions.VectorData.VectorStoreOperationException: Call to vector store failed.
---> Npgsql.PostgresException (0x80004005): 42601: syntax error at or near ";"
Metadata
Metadata
Assignees
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codeBuildFeatures planned for next Build conferenceFeatures planned for next Build conferencebugSomething isn't workingSomething isn't workingmsft.ext.vectordataRelated to Microsoft.Extensions.VectorDataRelated to Microsoft.Extensions.VectorData
Type
Projects
Status
Sprint: Done