Postgrex v0.12.2 Postgrex.Extensions.Calendar View Source

An extension that supports the calendar structs introduced in Elixir 1.3.0: Date, Time, DateTime and NaiveDateTime. This module won’t be compiled if the Elixir version is less than 1.3.0 because the structs do not exist.

This extension is not used by default, it needs to be included in the :extensions option to Postgrex.start_link/1. The option term is ignored by this extension.

Examples

Postgrex.start_link([extensions: [{Postgrex.Extensions.Calendar, []}]])

Link to this section Summary

Functions

Should decode a binary in the specified Postgres protocol format to an Elixir value

Should encode an Elixir value to a binary in the specified Postgres protocol format

Returns the format the type should be encoded as. See http://www.postgresql.org/docs/9.4/static/protocol-overview.html#PROTOCOL-FORMAT-CODES

Should perform any initialization of the extension. The function receives the server parameters (http://www.postgresql.org/docs/9.4/static/runtime-config.html) and user options. The options returned from this function will be passed to all other callbacks

Specifies the types the extension matches, see Postgrex.TypeInfo for specification of the fields

Link to this section Functions

Link to this function decode(type_info, value, _, _) View Source

Should decode a binary in the specified Postgres protocol format to an Elixir value.

Callback implementation for Postgrex.Extension.decode/4.

Link to this function encode(type_info, value, _, _) View Source

Should encode an Elixir value to a binary in the specified Postgres protocol format.

Callback implementation for Postgrex.Extension.encode/4.

Returns the format the type should be encoded as. See http://www.postgresql.org/docs/9.4/static/protocol-overview.html#PROTOCOL-FORMAT-CODES.

Callback implementation for Postgrex.Extension.format/1.

Should perform any initialization of the extension. The function receives the server parameters (http://www.postgresql.org/docs/9.4/static/runtime-config.html) and user options. The options returned from this function will be passed to all other callbacks.

Callback implementation for Postgrex.Extension.init/2.

Specifies the types the extension matches, see Postgrex.TypeInfo for specification of the fields.

Callback implementation for Postgrex.Extension.matching/1.