fix: Formatting

This commit is contained in:
Rain6435 2025-08-14 01:50:57 -04:00
parent 1a42e96a3b
commit a1e62ab422

View file

@ -112,26 +112,34 @@ class PgvectorClient(VectorDBBase):
try: try:
# Ensure the pgvector extension is available # Ensure the pgvector extension is available
# Use a conditional check to avoid permission issues on Azure PostgreSQL # Use a conditional check to avoid permission issues on Azure PostgreSQL
self.session.execute(text(""" self.session.execute(
text(
"""
DO $$ DO $$
BEGIN BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'vector') THEN IF NOT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'vector') THEN
CREATE EXTENSION IF NOT EXISTS vector; CREATE EXTENSION IF NOT EXISTS vector;
END IF; END IF;
END $$; END $$;
""")) """
)
)
if PGVECTOR_PGCRYPTO: if PGVECTOR_PGCRYPTO:
# Ensure the pgcrypto extension is available for encryption # Ensure the pgcrypto extension is available for encryption
# Use a conditional check to avoid permission issues on Azure PostgreSQL # Use a conditional check to avoid permission issues on Azure PostgreSQL
self.session.execute(text(""" self.session.execute(
text(
"""
DO $$ DO $$
BEGIN BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'pgcrypto') THEN IF NOT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'pgcrypto') THEN
CREATE EXTENSION IF NOT EXISTS pgcrypto; CREATE EXTENSION IF NOT EXISTS pgcrypto;
END IF; END IF;
END $$; END $$;
""")) """
)
)
if not PGVECTOR_PGCRYPTO_KEY: if not PGVECTOR_PGCRYPTO_KEY:
raise ValueError( raise ValueError(