Snowflex.DBConnection.Server (Snowflex v0.5.0)

Adapter to Erlang's :odbc module.

A GenServer that handles communication between Elixir and Erlang's :odbc module.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Disconnects from the ODBC driver.

Sends a parametrized query to the ODBC driver.

Sends a query to the ODBC driver.

Starts the connection process to the ODBC driver.

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

disconnect(pid)

Specs

disconnect(pid()) :: :ok

Disconnects from the ODBC driver.

Link to this function

param_query(pid, statement, params, opts \\ [])

Specs

param_query(pid(), iodata(), Keyword.t(), Keyword.t()) ::
  {:ok, {:selected, [binary()], [tuple()]}}
  | {:ok, {:selected, [binary()], [tuple()], [{binary()}]}}
  | {:ok, {:updated, non_neg_integer()}}
  | {:error, Snowflex.DBConnection.Error.t()}

Sends a parametrized query to the ODBC driver.

pid is the :odbc process id statement is the SQL query string params are the parameters to send with the SQL query opts are options to be passed on to :odbc

Link to this function

sql_query(pid, statement, opts \\ [])

Specs

sql_query(pid(), iodata(), Keyword.t()) ::
  {:ok, {:selected, [binary()], [tuple()]}}
  | {:ok, {:selected, [binary()], [tuple()], [{binary()}]}}
  | {:ok, {:updated, non_neg_integer()}}
  | {:error, Snowflex.DBConnection.Error.t()}

Sends a query to the ODBC driver.

pid is the :odbc process id statement is the SQL query string opts are options to be passed on to :odbc

Link to this function

start_link(opts)

Specs

start_link(Keyword.t()) :: {:ok, pid()}

Starts the connection process to the ODBC driver.