-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Labels
Description
Because many databases do not support direct encoding and decoding of embeds, it is often emulated by Ecto by using specific encoding and decoding rules.
For example, PostgreSQL will store embeds on top of JSONB columns, which means types in embedded schemas won’t go through the usual dump->DB->load cycle but rather encode->DB->decode->cast. This means that, when using embedded schemas with databases like PG or MySQL, make sure all of your types can be JSON encoded/decoded correctly. Ecto provides this guarantee for all built-in types.
Some thoughts:
- The values would need to be base64 encrypted in order to encode to JSON
- Ecto needs to call Cloak's
dumpfunctions in order to trigger the encryption