db_connection v0.1.2 DBConnection.Query protocol

The DBConnection.query protocol is responsible for preparing and encoding queries before they are passed to a connection.

Summary

Functions

Encodes a query

Prepare a query

Types

t :: term

Functions

encode(query, opts)

Specs

encode(any, Keyword.t) :: any

Encodes a query.

This function is called to encode a query once it has been prepared by a connection.

See DBConnection.execute/3.

prepare(query, opts)

Specs

prepare(any, Keyword.t) :: any

Prepare a query.

This function is called to prepare a query term for use with a connection callback module, either to prepare it further using the connection itself or for a query.

See DBConnection.query/3 and DBConnection.prepare/3.