db_connection v2.0.5 DBConnection.Query protocol View Source

The DBConnection.Query protocol is responsible for preparing and encoding queries.

Link to this section Summary

Functions

Decode a result using a query

Describe a query

Encode parameters using a query

Parse a query

Link to this section Types

Link to this section Functions

Link to this function decode(query, result, opts) View Source
decode(any(), any(), Keyword.t()) :: any()

Decode a result using a query.

This function is called to decode a result after it is returned by a connection callback module.

See DBConnection.execute/3.

Link to this function describe(query, opts) View Source
describe(any(), Keyword.t()) :: any()

Describe a query.

This function is called to describe a query after it is prepared using a connection callback module.

See DBConnection.prepare/3.

Link to this function encode(query, params, opts) View Source
encode(any(), any(), Keyword.t()) :: any()

Encode parameters using a query.

This function is called to encode a query before it is executed using a connection callback module.

If this function raises DBConnection.EncodeError, then the query is prepared once again.

See DBConnection.execute/3.

Link to this function parse(query, opts) View Source
parse(any(), Keyword.t()) :: any()

Parse a query.

This function is called to parse a query term before it is prepared using a connection callback module.

See DBConnection.prepare/3.