Replies: 1 comment
-
Are you building a single use solution (i.e for one School's needs) or more of a saas product? I have been working on a School Management platform using Elixir, we should talk :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I’m on my phone, so please forgive formatting..
In some cases it is advantageous to have the ability to add extra configuration to an entity without having to modify the database schema. EmbeddedSchema with
embeds_one
can be very useful here.https://hexdocs.pm/ecto/embedded-schemas.html#user-profile-example
In my specific case I am developing a module for a school management system, let’s say it’s a School, that integrates with a bunch of other school management systems, let’s say there are dozens of such systems and each one requires its own config (url, encrypted token, etc, etc).
it’s not open ended in the sense that it would make sense to have a separate table for the integrations, but it is open ended in the sense that each integration with require some arbitrary number/type of fields.
I’ve managed to model for a single case using virtual fields and some convoluted mapping logic and can repeat this for the next 6 integrations without too much hassle (copy and paste + LLM) but the pattern seems ugly.
It would be nice when defining my LiveResource I could so something like:
Then in my Ecto (pseudocode)
i hope that makes sense
Beta Was this translation helpful? Give feedback.
All reactions