MssqlEcto v1.2.0 MssqlEcto.Connection View Source

Link to this section Summary

Types

The cache query which is a DBConnection Query

The prepared query which is an SQL command

Functions

Receives options and returns DBConnection supervisor child specification

Executes the given prepared query with DBConnection

Returns a stream that prepares and executes the given query with DBConnection

Receives the exception returned by query/4. The constraints are in the keyword list and must return the constraint type, like :unique, and the constraint name as a string, for example:

[unique: "posts_title_index"]

Must return an empty list if the error does not come from any constraint

Link to this section Types

Link to this type cached() View Source
cached() :: map

The cache query which is a DBConnection Query

The prepared query which is an SQL command

Link to this section Functions

Link to this function child_spec(opts) View Source
child_spec(options :: Keyword.t) :: {module, Keyword.t}

Receives options and returns DBConnection supervisor child specification.

Link to this function delete(prefix, table, filters, returning) View Source
Link to this function execute(conn, query, params, options) View Source
execute(connection :: DBConnection.t, prepared_query :: cached, params :: [term], options :: Keyword.t) ::
  {:ok, term} |
  {:error | :reset, Exception.t}
execute(connection :: DBConnection.t, prepared_query :: prepared, params :: [term], options :: Keyword.t) ::
  {:ok, term} |
  {:error, Exception.t}

Executes the given prepared query with DBConnection.

Link to this function insert(prefix, table, header, rows, on_conflict, returning) View Source
Link to this function prepare_execute(conn, name, prepared_query, params, options) View Source
prepare_execute(connection :: DBConnection.t, name :: String.t, prepared, params :: [term], options :: Keyword.t) ::
  {:ok, query :: map, term} |
  {:error, Exception.t}

Prepares and executes the given query with DBConnection.

Link to this function stream(conn, prepared, params, options) View Source
stream(connection :: DBConnection.conn, prepared_query :: prepared, params :: [term], options :: Keyword.t) :: Enum.t

Returns a stream that prepares and executes the given query with DBConnection.

Link to this function to_constraints(error) View Source
to_constraints(exception :: Exception.t) :: Keyword.t

Receives the exception returned by query/4. The constraints are in the keyword list and must return the constraint type, like :unique, and the constraint name as a string, for example:

[unique: "posts_title_index"]

Must return an empty list if the error does not come from any constraint.

Link to this function update(prefix, table, fields, filters, returning) View Source
Link to this function update_all(query, prefix \\ nil) View Source