View Source Pointers (bonfire v0.3.0-classic-beta.4)

A context for working with Pointers, a sort of global foreign key scheme.

Link to this section Summary

Functions

Return the provided pointer when it belongs to table queryable by the given table search term.

Returns a Pointer, either the one provided or a synthesised one pointing to the provided schema object. Does not hit the database or cause the pointer to be written to the database whatsoever.

Given a list of pointers which may or may have their pointed loaded, return a plan for preloading, a map of module name to set of loadable IDs.

Returns a basic query over undeleted pointable objects in the system, optionally limited to one or more types.

Looks up the table for a given pointer

Link to this section Functions

Link to this function

assert_points_to!(pointer, term)

View Source

Return the provided pointer when it belongs to table queryable by the given table search term.

Returns a Pointer, either the one provided or a synthesised one pointing to the provided schema object. Does not hit the database or cause the pointer to be written to the database whatsoever.

Given a list of pointers which may or may have their pointed loaded, return a plan for preloading, a map of module name to set of loadable IDs.

Returns a basic query over undeleted pointable objects in the system, optionally limited to one or more types.

If the type is set to a Pointable, Virtual or Mixin schema, records will be selected from that schema directly. It is assumed this filters deleted records by construction.

Otherwise, will query from Pointer, filtering not is_nil(deleted_at)

Looks up the table for a given pointer