Table of Contents

Method AddVectorCollection

Namespace
Qavren.Edge.VectorData
Assembly
Qavren.Edge.VectorData.dll

AddVectorCollection<TKey, TRecord>(EdgeBuilder, string, Action<EdgeVectorStoreCollectionOptions>?, string?)

The ad-hoc alternative: an IEdgeStartupTask at order 300 calling EnsureCollectionExistsAsync. Same SQL, no version bookkeeping.

The task opens a connection from inside the startup sequence, which works because IEdgeHost.EnsureStartedAsync returns at once when a startup task calls it: the order-10 open and the order-100 migrations have completed by order 300, and that is all this needs. AddVectorCollectionMigration<TKey, TRecord>(EdgeBuilder, int, string, string?, Action<EdgeVectorStoreCollectionOptions>?) remains the recommended path, because a migration is versioned and this is not.

[RequiresDynamicCode("Reflects over TRecord. Use the VectorStoreCollectionDefinition overload in trimmed or AOT apps.")]
[RequiresUnreferencedCode("Reflects over TRecord. Use the VectorStoreCollectionDefinition overload in trimmed or AOT apps.")]
public static EdgeBuilder AddVectorCollection<TKey, TRecord>(this EdgeBuilder builder, string collectionName, Action<EdgeVectorStoreCollectionOptions>? configure = null, string? storeName = null) where TKey : notnull where TRecord : class

Parameters

builder EdgeBuilder

The Qavren.Edge builder.

collectionName string

The collection name.

configure Action<EdgeVectorStoreCollectionOptions>

Configures the per-collection overrides.

storeName string

The keyed store to resolve the database from. Null is the unnamed store.

Returns

EdgeBuilder

The builder, for chaining.

Type Parameters

TKey

The key type.

TRecord

The record type.