79513032

Date: 2025-03-16 18:31:35
Score: 2
Natty:
Report link

Okay, it took me a while to figure out the answer but it turns out that supabase has three connection methods to their databases.

  1. Direct connection: Ideal for applications with persistent, long-lived connections, such as those running on virtual machines or long-standing containers.
  2. Transaction pooler: Ideal for stateless applications like serverless functions where each interaction with Postgres is brief and isolated.
  3. Session pooler: Only recommended as an alternative to Direct Connection, when connecting via an IPv4 network.

The connection method I used was the Direct connection with the provided connection string but it turns out that it doesnt allow ipv4 connections. By default, the network created by my docker compose file sets ipv6 as false. The solution? From this there are two solutions.

  1. Create a network that supports ipv6 if you want to use the direct connection uri string.
  2. Use either of the other two connection uri strings since they support ipv4 connections
Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Kingdawnage