Ecto v2.0.2 Ecto.Adapters.SQL.Connection behaviour
Specifies the behaviour to be implemented by all SQL connections.
Summary
Callbacks
Receives a query and must return a SELECT query
Receives options and returns DBConnection
supervisor child
specification
Returns a DELETE for the filters
returning the given returning
Receives a query and must return a DELETE query
Executes the given prepared query with DBConnection
Receives a DDL command and returns a query that executes it
Returns an INSERT for the given rows
in table
returning
the given returning
Prepares and executes the given query with DBConnection
Receives the exception returned by query/4
Returns an UPDATE for the given fields
in table
filtered by
filters
returning the given returning
Receives a query and values to update and must return an UPDATE query
Types
Callbacks
Specs
all(query :: Ecto.Query.t) :: String.t
Receives a query and must return a SELECT query.
Receives options and returns DBConnection
supervisor child
specification.
Specs
Returns a DELETE for the filters
returning the given returning
.
Specs
delete_all(query :: Ecto.Query.t) :: String.t
Receives a query and must return a DELETE query.
Specs
execute(connection :: DBConnection.t, prepared_query :: prepared | cached, params :: [term], options :: Keyword.t) ::
{:ok, term} |
{:error, Exception.t}
Executes the given prepared query with DBConnection
.
Specs
execute_ddl(command :: Ecto.Adapter.Migration.command) :: String.t
Receives a DDL command and returns a query that executes it.
Specs
Returns an INSERT for the given rows
in table
returning
the given returning
.
Specs
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
.
Specs
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.
Specs
Returns an UPDATE for the given fields
in table
filtered by
filters
returning the given returning
.
Specs
update_all(query :: Ecto.Query.t) :: String.t
Receives a query and values to update and must return an UPDATE query.