243 shaares
Have you ever wanted or had the need to take a database table and cram a lot of information into a specific field using JSON?
This is possible and supported by both PostgreSQL and Ecto, and it can sometimes simplify your database in cases where you absolutely want to store some kind of nested data structure.
This post shortly describes how to create embedded schemas in Ecto to save a JSON data structure on your database, and how to implement a direct database search on this same field.