View Source Needle.Pointers (needle v0.8.0)

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

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 non-deleted pointable objects in the system, optionally limited to one or more types.

Looks up the table for a given pointer

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 non-deleted 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