Search⌘ K
AI Features

Delete with Schemas

Understand how to delete records from a database using Ecto schemas in Elixir. This lesson covers using Repo.delete for individual records and delete_all for bulk deletions, emphasizing precise queries. You'll also be introduced to updates and changesets as a foundation for modifying data.

Delete with schemas

Now let’s look at how to delete records. When we first looked at delete_all here, we used it to remove all of the records in the table, like so:

Elixir
Repo.delete_all("tracks")

When we ...