Small elixir snippets that actually works, now thats called fun.
Automating tedious jobs are sure fun. I am writting an Roomfinder application as a part of my through learning elixir, phoenix and web development as a whole.
I am from Nepal. Nepal has 77 district and 7 States. I needed to create a database table from it.
I added above json file in priv/static/json/district_list.json
Then generated context using
mix phx.gen.context Districts District districts name state:integer
mix ecto.migrate
Then in seeds.exs file I added a script to read the file and loop through all and insert it to database.
And thats it without any error all address are now inside my postgres database.