ExTenant.generate_prepare_query_callback
You're seeing just the macro
generate_prepare_query_callback
, go back to ExTenant module for more information.
generate a function signature that does this
def prepare_query(operation, query, opts) do
inspect_query_data(operation, query, opts)
cond do
opts[:skip_tenant_id] || opts[:schema_migration] ->
{query, opts}
tenant_id = opts[:tenant_id] ->
{Ecto.Query.where(query, tenant_id: ^tenant_id), opts}
true ->
raise ExTenant.TenantNotSetError
end
end