Table of Contents

Constructor PgVectorEmbeddingStore

Namespace
LMKit.Data.Storage.PgVector
Assembly
LM-Kit.NET.Data.Connectors.PgVector.dll

PgVectorEmbeddingStore(NpgsqlDataSource, bool, string)

Initializes a new instance of the PgVectorEmbeddingStore class using the specified Npgsql.NpgsqlDataSource.

public PgVectorEmbeddingStore(NpgsqlDataSource dataSource, bool ownsDataSource = false, string schema = "public")

Parameters

dataSource NpgsqlDataSource

The Npgsql.NpgsqlDataSource used to obtain pooled connections to the PostgreSQL service. The data source must target a database where the vector extension is available.

ownsDataSource bool

If true, the store takes ownership of the data source and will dispose it when the store is disposed. If false (default), the caller retains ownership and is responsible for disposing the data source.

schema string

The PostgreSQL schema that holds the collection tables. Defaults to public when null or empty. The schema is created on demand when a collection is created.

Exceptions

ArgumentNullException

Thrown if dataSource is null.

PgVectorEmbeddingStore(string, string)

Initializes a new instance of the PgVectorEmbeddingStore class from a PostgreSQL connection string. The store builds and owns an internal pooled Npgsql.NpgsqlDataSource.

public PgVectorEmbeddingStore(string connectionString, string schema = "public")

Parameters

connectionString string

A standard Npgsql connection string pointing at the target PostgreSQL database, for example Host=localhost;Username=postgres;Password=secret;Database=vectors.

schema string

The PostgreSQL schema that holds the collection tables. Defaults to public when null or empty. The schema is created on demand when a collection is created.

Exceptions

ArgumentException

Thrown when connectionString is null, empty, or whitespace.

Share