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

Sets up an Ecto Schema for a Pointable table.

sample-usage

Sample Usage

use Pointers.Pointable,
  otp_app: :my_app,   # your OTP application's name
  source: "my_table", # default name of table in database
  table_id: "01EBTVSZJ6X02J01R1XWWPWGZW" # unique ULID to identify table

pointable_schema do
  # ... fields go here, if any
end

overriding-with-configuration

Overriding with configuration

During use (i.e. compilation time), we will attempt to load configuration from the provided :otp_app under the key of the current module. Any values provided here will override the defaults provided to use. This allows you to configure them after the fact.

Additionally, pointables use Flexto's flex_schema(), so you can provide additional configuration for those in the same place.

I shall say it again because it's important: This happens at compile time. You must rebuild the app containing the pointable whenever the configuration changes.

introspection

Introspection

Defines a function __pointers__/1 to introspect data. Recognised parameters:

:role - :pointable :table_id - retrieves the ULID id of the pointable table. :otp_app - retrieves the OTP application to which this belongs.

Link to this section Summary

Link to this section Functions

Link to this macro

pointable_schema(body)

View Source (macro)