SupabaseS
Supabase12mo ago
haroon

supabase – alembic connection string URI error

trying to connect to my supabase database with alembic to run db migrations using Connection String URIs

(1) when using the Direct Connection conn string
  File "/Users/hbak/Desktop/gio/llm-pdf/.venv/lib/python3.13/site-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db.rzjmahpovkyuouybhfhy.supabase.co" to address: nodename nor servname provided, or not known


(2) when using the Transaction Pooler conn string
works perfectly fine

obviously will use the Transaction Pooler, but considering the application will likely be long running it makes more sense to get the Direct Connection working if possible
Was this page helpful?