migrate_sqlite_to_pgvector
migrate_sqlite_to_pgvector
Migrate a .swsearch SQLite index to a pgvector collection in PostgreSQL.
Chunks are transferred in batches with their embeddings, metadata, and tags preserved.
Parameters
sqlite_path
Path to the source .swsearch file.
connection_string
PostgreSQL connection string (e.g., "postgresql://user:pass@host/db").
collection_name
Name for the target pgvector collection.
overwrite
Drop and recreate the collection if it already exists.
batch_size
Number of chunks to insert per batch.
Returns
dict[str, Any] — Migration statistics containing:
source(str) — source file pathtarget(str) — target collection namechunks_migrated(int) — number of successfully migrated chunkserrors(int) — number of failed chunksconfig(dict) — source index configuration