db_connection v1.1.0 DBConnection.Query protocol

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

Summary

Functions

Decode a result using a query

Describe a query

Encode parameters using a query

Parse a query

Types

t :: term

Functions

decode(query, result, opts)

Specs

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.

describe(query, opts)

Specs

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.

encode(query, params, opts)

Specs

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.

See DBConnection.execute/3.

parse(query, opts)

Specs

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.