MssqlEcto v0.1.1 MssqlEcto.Connection

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

Types

cached()
cached() :: map

The cache query which is a DBConnection Query

prepared()
prepared() :: String.t

The prepared query which is an SQL command

Functions

all(query)
child_spec(opts)
child_spec(options :: Keyword.t) :: {module, Keyword.t}

Receives options and returns DBConnection supervisor child specification.

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

Executes the given prepared query with DBConnection.

execute_ddl(command)
insert(prefix, table, header, rows, on_conflict, returning)
prepare_execute(conn, name, prepared_query, params, options)
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.

storage_down(opts)
storage_up(opts)
stream(conn, prepared, params, options)
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.

structure_dump(default, config)
structure_load(default, config)
supports_ddl_transaction?()
to_constraints(error)
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.

update(prefix, table, fields, filters, returning)
update_all(query, prefix \\ nil)