Introduction to Upserts

Learn how to insert and update in Ecto using upserts.

Why do we need upserts?

Let’s say we wanted to front-load our music database’s genres table with every musical genre we could think of. We might choose to create a Comma-separated values (CSV) file with all the data we want to load, then write some code to parse the file and insert the data into the database. At first ...