amigrate_pgvector_collection#
- async langchain_postgres.utils.pgvector_migrator.amigrate_pgvector_collection(
- engine: PGEngine,
- collection_name: str,
- vector_store: PGVectorStore,
- delete_pg_collection: bool | None = False,
- insert_batch_size: int = 1000,
Migrate all data present in a PGVector collection to use separate tables for each collection. The new data format is compatible with the PGVectorStore interface.
- Parameters:
engine (PGEngine) – The PG engine corresponding to the Database.
collection_name (str) – The collection to migrate.
vector_store (PGVectorStore) – The PGVectorStore object corresponding to the new collection table.
use_json_metadata (bool) – An option to keep the PGVector metadata as json in the new table. Default: False. Optional.
delete_pg_collection (bool) – An option to delete the original data upon migration. Default: False. Optional.
insert_batch_size (int) – Number of rows to insert at once in the table. Default: 1000.
- Return type:
None