# `Electric.Connection.Supervisor`
[🔗](https://github.com/electric-sql/electric/tree/%40core/sync-service%401.6.2/packages/sync-service/lib/electric/connection/supervisor.ex#L1)

The main connection supervisor that looks after Connection.Manager.

It starts Connection.Manager.Supervisor which then directly supervises
Connection.Manager and ConnectionResolver processes.

Connection.Manager acts a bit like a supervisor for database connection processes:

  - it opens database connections in the right order
  - restarts them during initialization if they fail for recoverable reasons
  - restarts the replication client at any point if it crashes due to a non-fatal error
  - coordinates with CoreSupervisor to start the Shapes.Supervisor at the right point
    in time, passing it the right set of options that have been informed by connection
    manager's own initialization sequence up to that point

If a database connection shuts down due to a non-recoverable error, the connection manager
process will ask this supervisor to shut down, which in the single-tenant mode results in the
whole OTP application shutting down.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `init`

# `name`

# `shutdown`

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
