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
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
disconnect(pid)
Specs
disconnect(pid()) :: :ok
Disconnects from the ODBC driver.
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
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
start_link(opts)
Specs
Starts the connection process to the ODBC driver.