Set flag in query options to detect oban query #687
Labels
area:oss
Related to Oban OSS
closed:wontfix
This will not be worked on
kind:enhancement
New feature or request
Is your feature request related to a problem? Please describe.
We're using multi tenancy like in the following Ecto documentation: https://hexdocs.pm/ecto/multi-tenancy-with-foreign-keys.html
and we have the problem that oban queries fail as the repo
expected org_id or skip_org_id to be set
. For migrations there is a check for:schema_migration
, but as far as I can see oban queries can currently only be detected by looking into the:telemetry_options
.Describe the Solution You'd Like
I'd imagine oban setting a flag like
:oban
to true for oban queries (probably here). Adding a note to the documentation about this use case would be great.Describe Alternatives You've Considered
I tried adding a new repo module only for oban, but this is clumsy and seems to cause ecto sandbox errors when running tests.
Additional Context
Currently, I check for
opts[:schema_migration] || get_in(opts, [:telemetry_options, :oban])
which works, but could probably break in the future.The text was updated successfully, but these errors were encountered: