ecto_mnesia v0.6.6 Ecto.Mnesia.Record.Context

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

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

Functions

assign_query(context, query, sources)

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

find_field_index!(field, context)

Returns MatchSpec record field index by a field name.

Raises if field is not found in a context.

find_field_placeholder!(field, context)

Returns a Mnesia MatchSpec body placeholder for a field.

Raises if field is not found in a context.

get_fields_placeholders(context)

Returns MatchSpec body placeholders for all fields in a context.

get_match_spec(context)

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

new(table, schema)

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