Phoenix & Elm landing page (pt.3) Building a Rasberry Pi weather station with Elixir/Nerves - Part 3

Lesson 13 Adding Ecto and a Postgres database to StatWatch

Our StatWatch module has been serving Alchemist.Camp well, but let’s add a database and work towards eliminating our reliance on .csv files.

This is our first video to cover Ecto so we went into some detail about getting it set up, creating a user for our db in psql, running various Ecto mix tasks, setting up an Ecto Schema for our table, and then doing basic CRUD from inside iex before jumping into the application’s code.

Finally we dealt with a common mix error that comes up when using ecto in an otp sub-application that’s not an umbrella project.

Today’s challenge: Read over the docs on Ecto Associations (https://hexdocs.pm/ecto/associations.html#content)

Then figure out how we could create an association between the profiles we’re collecting stats for and the stats we’ve collected.

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.