• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supavisor / 22685842482

04 Mar 2026 07:34PM UTC coverage: 78.255% (+3.1%) from 75.154%
22685842482

Pull #865

github

web-flow
Merge 0c00c3cdf into cdc0a6724
Pull Request #865: fix: use a pool for starting proxy connections

25 of 58 new or added lines in 6 files covered. (43.1%)

11 existing lines in 3 files now uncovered.

2404 of 3072 relevant lines covered (78.26%)

4027.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/supavisor/client_handler/proxy.ex
1
defmodule Supavisor.ClientHandler.Proxy do
2
  @moduledoc """
3
  Handles proxy connection logic for ClientHandler.
4

5
  This module prepares proxy connections and database handler arguments
6
  while leaving socket operations and process management to ClientHandler.
7
  """
8

9
  @spec prepare_proxy_connection(map()) ::
10
          {:ok, map()} | {:error, term()}
11
  def prepare_proxy_connection(data) do
12
    case Supavisor.get_pool_ranch(data.id) do
13
      {:ok, %{port: port, host: host}} ->
14
        updated_auth =
15
          Map.merge(data.auth, %{
16
            port: port,
17
            host: to_charlist(host),
18
            ip_version: :inet,
19
            upstream_ssl: false,
20
            upstream_tls_ca: nil,
21
            upstream_verify: nil
22
          })
23

24
        {:ok, %{data | auth: updated_auth}}
25

NEW
26
      error ->
×
27
        {:error, error}
28
    end
29
  end
30

31
  @spec build_db_handler_args(map()) :: map()
32
  def build_db_handler_args(data) do
33
    %{
34
      id: data.id,
NEW
35
      auth: data.auth,
×
NEW
36
      user: data.user,
×
37
      tenant: {:single, data.tenant},
38
      tenant_feature_flags: data.tenant_feature_flags,
39
      replica_type: :write,
40
      mode: :proxy,
41
      proxy: true,
42
      log_level: nil
43
    }
44
  end
45
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc