(Postgrex.Error) ERROR 42P18 (indeterminate_datatype): could not determine data type of parameter $2
Now I can understand why PG is complaining but, so far, I’ve not been able to come up
with a solution. I’ve tried macros too, but being an Elixir newbie all the attempts failed.
Hi, my understanding is that the change you propose only deals with default values
while my code also impose that opts must be a map (sure, I could leverage guard clauses for that too).
(Ecto.Query.CastError) lib/core/accounts/accounts.ex:59: value `:organisation_id` in `where` cannot be cast to type :binary_id in query:
from a in Core.Accounts.Account,
where: a.id == ^"3d75d923-7c62-448c-8ad8-5f0bb7fbd44c",
where: fragment("? IS NULL", type(^:organisation_id, :binary_id)),
select: a
That does not do the same thing though. opts=%{} \\ %{} is a common pattern that I do as well, it means it defaults to a map via the \\ %{} and the =%{} means that if a user passes in something then it must be a map. By removing the =%{} you are letting the user pass in anything and potentially crash.