View Source Csv2sql.Database.ConnectionTest (Csv2sql v1.0.0)

Tests the connection to the database

Summary

Types

@type connect_args() :: %{
  db_type: :mysql | :postgres,
  db_url: String.t(),
  caller: pid()
}

Functions

@spec attempt_connection(connect_args()) ::
  {:connected, pid()} | {:error, DBConnection.ConnectionError.t()}
Link to this function

check_db_connection(caller)

View Source
@spec check_db_connection(pid()) :: :ok
Link to this function

check_db_connection(caller, args)

View Source
@spec check_db_connection(pid(), map()) :: {:error, :on_going | String.t()}

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec start_link(any()) :: :ignore | {:error, any()} | {:ok, pid()}