5/6
---
📣 🏴☠️ Camp! expedition: We have some open bounties to improve bonfire performance :
Read more: https://indieweb.social/@bonfire/112943944096656953
Repository: https://github.com/bonfire-networks/bounties
#ecto#myElixirStatus #elixir
6/6
5/6
We needed the flexibility to have a foreign key that can reference any referenceable object. We call our system Needle.
5/6
A social network, by contrast, usually requires a graph of objects, meaning objects need to be able to refer to other objects by their ID without knowing their type.
A simple example would be likes, you might have a likes table with liked_post_id field that references the post table.
We needed the flexibility to have a foreign key that can reference any referenceable object. We call our system Needle.
When using a relational DB (such an Ecto schema with a Postgres table), usually a foreign key field has to be pre-defined with a reference pointing to a specific field in a specific table.
2/6
A social network, by contrast, usually requires a graph of objects, meaning objects need to be able to refer to other objects by their ID without knowing their type.
A simple example would be likes, you might have a likes table with liked_post_id field that references the post table.
🔗 Read the docs: https://hexdocs.pm/needle/readme.html
💬 Join the discussion on Elixir Forum: https://elixirforum.com/t/needle-universal-foreign-keys-shared-data-fields-virtual-and-configurable-schemas-for-ecto/65644