pub struct PostgresVectorStorage { /* private fields */ }
Expand description
PostgreSQL vector storage implementation using pgvector
Implementations§
Source§impl PostgresVectorStorage
impl PostgresVectorStorage
Sourcepub async fn new(database_url: &str) -> Result<Self>
pub async fn new(database_url: &str) -> Result<Self>
Create a new PostgreSQL vector storage instance
Sourcepub async fn with_config(config: PostgresConfig) -> Result<Self>
pub async fn with_config(config: PostgresConfig) -> Result<Self>
Create a new PostgreSQL vector storage instance with configuration
Trait Implementations§
Source§impl VectorStorage for PostgresVectorStorage
impl VectorStorage for PostgresVectorStorage
Source§type Config = PostgresConfig
type Config = PostgresConfig
Storage-specific configuration type
Source§fn create_index<'life0, 'async_trait>(
&'life0 self,
config: IndexConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_index<'life0, 'async_trait>(
&'life0 self,
config: IndexConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new vector index
Source§fn list_indexes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_indexes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all available indexes
Source§fn describe_index<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<IndexInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn describe_index<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<IndexInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get information about a specific index
Source§fn delete_index<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_index<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete an index and all its vectors
Source§fn upsert_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
documents: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Result<Vec<DocumentId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upsert_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
documents: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Result<Vec<DocumentId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert or update documents in the index
Source§fn search<'life0, 'async_trait>(
&'life0 self,
request: SearchRequest,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search<'life0, 'async_trait>(
&'life0 self,
request: SearchRequest,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Search for similar vectors
Source§fn update_document<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
document: Document,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_document<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
document: Document,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a specific document
Source§fn delete_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
ids: Vec<DocumentId>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
ids: Vec<DocumentId>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete documents by IDs
Source§fn get_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
ids: Vec<DocumentId>,
include_vectors: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Document>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_documents<'life0, 'life1, 'async_trait>(
&'life0 self,
index_name: &'life1 str,
ids: Vec<DocumentId>,
include_vectors: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Document>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get documents by IDs
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the storage backend is healthy
Source§fn backend_info(&self) -> BackendInfo
fn backend_info(&self) -> BackendInfo
Get storage backend information
Auto Trait Implementations§
impl Freeze for PostgresVectorStorage
impl !RefUnwindSafe for PostgresVectorStorage
impl Send for PostgresVectorStorage
impl Sync for PostgresVectorStorage
impl Unpin for PostgresVectorStorage
impl !UnwindSafe for PostgresVectorStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more