Class: PgVectorStore
Defined in: src/batteries/vector/pgvector/index.ts:159
Abstract base shared by every bundled vector adapter. It implements the cross-cutting surface (query/schema/transaction/asCallable/encode) on top of the small set of backend-specific abstract methods each adapter fills in (connect, executeSearch, createCollection, …). Concrete adapters inherit the doc comments below unless they override them.
Extends
Constructors
Constructor
new PgVectorStore(options: PgVectorStoreOptions): PgVectorStore;Defined in: src/batteries/vector/pgvector/index.ts:174
Parameters
| Parameter | Type |
|---|---|
options | PgVectorStoreOptions |
Returns
PgVectorStore
Overrides
Properties
| Property | Modifier | Type | Description | Overrides | Defined in |
|---|---|---|---|---|---|
capabilities | readonly | VectorStoreCapabilities | Static description of what this backend supports — see VectorStoreCapabilities. | BaseVectorStore.capabilities | src/batteries/vector/pgvector/index.ts:160 |
Accessors
clientOrPool
Get Signature
get clientOrPool(): any;Defined in: src/batteries/vector/pgvector/index.ts:249
The active transaction client when inside a transaction, otherwise the connection pool.
Returns
any
schema
Get Signature
get schema(): VectorSchemaBuilder;Defined in: src/batteries/vector/contract.ts:109
Schema builder bound to this store, for creating/dropping/migrating collections.
Returns
Inherited from
Methods
asCallable()
asCallable(): CallableVectorStore;Defined in: src/batteries/vector/contract.ts:123
Wrap this store in a callable proxy so store('collection') is shorthand for store.query('collection'), while all other methods/properties pass through unchanged.
Returns
Inherited from
close()
close(): Promise<void>;Defined in: src/batteries/vector/pgvector/index.ts:234
Release the backing connection and any held resources.
Returns
Promise<void>
Overrides
connect()
connect(): Promise<void>;Defined in: src/batteries/vector/pgvector/index.ts:190
Establish the backing connection (open clients, pools, sockets). Idempotent where the driver allows.
Returns
Promise<void>
Overrides
createCollection()
createCollection(spec: CollectionSpec, ifNotExists: boolean): Promise<void>;Defined in: src/batteries/vector/pgvector/index.ts:264
Create a collection from spec; a no-op when ifNotExists and it already exists.
Parameters
| Parameter | Type |
|---|---|
spec | CollectionSpec |
ifNotExists | boolean |
Returns
Promise<void>
Overrides
BaseVectorStore.createCollection
dropCollection()
dropCollection(collection: string, ifExists: boolean): Promise<void>;Defined in: src/batteries/vector/pgvector/index.ts:296
Drop a collection; a no-op when ifExists and it is absent.
Parameters
| Parameter | Type |
|---|---|
collection | string |
ifExists | boolean |
Returns
Promise<void>
Overrides
BaseVectorStore.dropCollection
ensureConnected()
ensureConnected(): Promise<void>;Defined in: src/batteries/vector/pgvector/index.ts:260
Ensure the pool is connected (idempotent); a no-op once connected.
Returns
Promise<void>
executeDelete()
executeDelete(plan: DeletePlan): Promise<void>;Defined in: src/batteries/vector/pgvector/index.ts:536
Execute a compiled delete plan.
Parameters
| Parameter | Type |
|---|---|
plan | DeletePlan |
Returns
Promise<void>
Overrides
executeSearch()
executeSearch(plan: SearchPlan): Promise<VectorMatch[]>;Defined in: src/batteries/vector/pgvector/index.ts:406
Execute a compiled search plan and return the matched records.
Parameters
| Parameter | Type |
|---|---|
plan | SearchPlan |
Returns
Promise<VectorMatch[]>
Overrides
executeUpsert()
executeUpsert(plan: UpsertPlan): Promise<void>;Defined in: src/batteries/vector/pgvector/index.ts:347
Execute a compiled upsert plan (insert-or-replace the given records).
Parameters
| Parameter | Type |
|---|---|
plan | UpsertPlan |
Returns
Promise<void>
Overrides
hasCollection()
hasCollection(collection: string): Promise<boolean>;Defined in: src/batteries/vector/pgvector/index.ts:316
Whether a collection currently exists in the backend.
Parameters
| Parameter | Type |
|---|---|
collection | string |
Returns
Promise<boolean>
Overrides
isAvailable()
isAvailable(): boolean;Defined in: src/batteries/vector/pgvector/index.ts:186
Whether the backend's optional peer dependency is installed and the store is usable.
Returns
boolean
Overrides
query()
query(collection: string): VectorQueryBuilder;Defined in: src/batteries/vector/contract.ts:114
Open a VectorQueryBuilder scoped to collection (default top-K of 10).
Parameters
| Parameter | Type |
|---|---|
collection | string |
Returns
Inherited from
renameCollection()
renameCollection(from: string, to: string): Promise<void>;Defined in: src/batteries/vector/pgvector/index.ts:327
Rename a collection from from to to.
Parameters
| Parameter | Type |
|---|---|
from | string |
to | string |
Returns
Promise<void>
Overrides
BaseVectorStore.renameCollection
transaction()
transaction(fn: (tx: CallableVectorStore) => Promise<void>): Promise<void>;Defined in: src/batteries/vector/pgvector/index.ts:558
Run fn inside a backend transaction. The base implementation rejects with E_VECTOR_STORE_TRANSACTIONS_UNSUPPORTED; adapters whose backend supports transactions override this.
Parameters
| Parameter | Type |
|---|---|
fn | (tx: CallableVectorStore) => Promise<void> |
Returns
Promise<void>
Overrides
isAvailable()
static isAvailable(): boolean;Defined in: src/batteries/vector/pgvector/index.ts:183
Static availability probe: whether this adapter's runtime driver can load in the current environment.
Returns
boolean