ecto_mnesia v0.9.1 EctoMnesia.Record.Context

Context stores table, query and match_spec that can be used for conversions between schemas and Mnesia records.

Link to this section Summary

Functions

Assigns Ecto.Query to a context and rebuilds MatchSpec with updated data

Returns MatchSpec record field index by a field name

Returns a Mnesia MatchSpec body placeholder for a field

Returns MatchSpec body placeholders for all fields in a context

Returns match spec that can be used in :mnesia.select/3

Creates new context table, and stores schema meta information that can be used to reconstruct query result

Link to this section Functions

Link to this function assign_query(context, query, sources)

Assigns Ecto.Query to a context and rebuilds MatchSpec with updated data.

Link to this function find_field_index!(field, context)

Returns MatchSpec record field index by a field name.

Raises if field is not found in a context.

Link to this function find_field_placeholder!(field, context)

Returns a Mnesia MatchSpec body placeholder for a field.

Raises if field is not found in a context.

Link to this function get_fields_placeholders(context)

Returns MatchSpec body placeholders for all fields in a context.

Link to this function get_match_spec(context)

Returns match spec that can be used in :mnesia.select/3.

Link to this function new(table, schema)

Creates new context table, and stores schema meta information that can be used to reconstruct query result.