Mssqlex v0.0.7 Mssqlex

Interface for interacting with MS SQL Server via an ODBC driver for Elixir.

It implements DBConnection behaviour, using :odbc to connect to the system’s ODBC driver. Requires MS SQL Server ODBC driver, see README for installation instructions.

Summary

Functions

Executes a query against an MS SQL Server with ODBC

Connect to a MS SQL Server using ODBC

Functions

query(conn, statement, params, opts \\ [])
query(pid, Mssqlex.Query.t, [{:odbc.odbc_data_type, [any]}], Keyword.t) :: {:ok, iodata, Mssqlex.Result.t}
query(pid, Mssqlex.Query.t, [{:odbc.odbc_data_type, [any]}], Keyword.t) :: {iodata, Mssqlex.Result.t}

Executes a query against an MS SQL Server with ODBC.

Statement and params should be in the format required by the Erlang ODBC application.

For examples see Using the Erlang API guide.

query!(conn, statement, params, opts \\ [])
start_link(opts)
start_link(Keyword.t) :: {:ok, pid}

Connect to a MS SQL Server using ODBC.

Options

  • :odbc_driver - The driver ODBC will use (default: {ODBC Driver 13 for SQL Server})
  • :hostname - The server hostname (default: localhost)
  • :database - The name of the database (default: MSSQL_DB environment variable)
  • :username - Username (default: MSSQL_UID environment variable)
  • :password - User password (default: MSSQL_PWD environment variable)

Mssqlex uses the DBConnection framework and supports all DBConnection options like :idle, :after_connect etc. See DBConnection.start_link/2 for more information.

Examples

iex> {:ok, pid} = Mssqlex.start_link(database: "mr_microsoft")
{:ok, #PID<0.70.0>}