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.

Known limitation, unresolved as of 2026-09-11. A task running inside the startup sequence cannot open a database connection: IEdgeDatabase.OpenConnectionAsync awaits IEdgeHost.EnsureStartedAsync, and that barrier only lifts once every startup task - including this one - has returned, so the host deadlocks. Sub-project 1 solves this for its own order-10 and order-100 tasks with an internal EdgeDatabase.OpenCoreAsync, which this package cannot reach. Until sub-project 1 exposes a startup-safe open, use AddVectorCollectionMigration<TKey, TRecord>(EdgeBuilder, int, string, string?, Action<EdgeVectorStoreCollectionOptions>?) (the recommended path anyway) or call EnsureCollectionExistsAsync yourself after the host has started.

[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.