Viewing old Oban Jobs

Generally when using Ecto.Query you query from a specific model like from(c in Customers, where... but with Oban my project dosen’t seem to have a specific model. The migration is added to the database with Oban.Migrations.up() but that’s the only place in the codebase that seems to reference the oban_jobs table.

I was trying to write a query with a fragment but having limited success, again, because it seemed like Ecto wanted a model to use with the fragment.

What is the best way to view old, (successful or failed) jobs from Oban?

Oban ships with a schema for its table so you can: from(j in Oban.Job, ...)

5 Likes