ExSqlClient v0.1.0 ExSqlClient View Source

This module implements DbConnection to handle connections to a Microsoft SQL Server database

Link to this section Summary

Functions

Creates a supervisor child specification for a pool of connections. See start_link/2 for options.

Prepare a query with a database connection for later execution. It returns {:ok, query} on success or {:error, exception} if there was an error. The returned query can then be passed to execute/4 and/or close/3

Executes a query on a given connection. Returns {:ok, result} or {:error, reason}.

Starts and links to a database connection process. By default the DBConnection starts a pool with a single connection. The size of the pool can be increased with :pool_size. A separate pool can be given with the :pool option.

Link to this section Functions

Creates a supervisor child specification for a pool of connections. See start_link/2 for options.

Link to this function

close(conn, query, opts \\ [])

View Source

See DBConnection.close/3.

Link to this function

execute(conn, query, params, opts \\ [])

View Source

See DBConnection.execute/4.

Link to this function

prepare(conn, query, opts \\ [])

View Source

Prepare a query with a database connection for later execution. It returns {:ok, query} on success or {:error, exception} if there was an error. The returned query can then be passed to execute/4 and/or close/3

Link to this function

query(conn, query, params \\ %{}, opts \\ [])

View Source

Executes a query on a given connection. Returns {:ok, result} or {:error, reason}.

See DBConnection.rollback/2.

Starts and links to a database connection process. By default the DBConnection starts a pool with a single connection. The size of the pool can be increased with :pool_size. A separate pool can be given with the :pool option.

Link to this function

transaction(conn, fun, opts \\ [])

View Source

See DBConnection.transaction/3.