Skip to main content

Module pgvector

Module pgvector 

Source
Expand description

PGVector vector store (PostgreSQL + pgvector extension)

This module provides helper utilities for PGVector. The full PGVectorStore implementation requires sqlx and pgvector crates, which must be added by the user to their own Cargo.toml due to potential conflicts with rusqlite (libsqlite3-sys linkage).

To use PGVectorStore, add these to your Cargo.toml:

sqlx = { version = "0.7", features = ["runtime-tokio", "postgres"] }
pgvector = { version = "0.3", features = ["sqlx"] }

Then enable the pgvector-storage feature and include the implementation from the project’s src/vector_stores/pgvector.rs.

Functions§

build_table_sql
Build CREATE TABLE SQL (pure function, convenient for testing)
validate_table_name
Validate that a table name is safe for SQL interpolation.