I’m using Repo.all from u in User, where: u.id in ^id_list, but was trying to also see if we could interpolate the list into "SELECT * FROM users WHERE id IN ($1)", [id_list], it seems like such a basic operation that we can’t write as raw SQL using Ecto/Postgres
I believe it’s due to PostgreSQL expecting a single argument in that position and Ecto/Postgrex sends a list (because you’re doing it manually, it doesn’t know what the DB wants). It would probably work if you sent a comma-separated string list (Enum.join(id_list, ",")) or used that = ANY($1) instead.
Maybe it would work without the parentheses around $1 but I did not test. That makes sense though, PostgreSQL is reading it like you want to query id in (15), i.e. single value. If you wanted multiple, you’d have to use id in ($1, $2, $3).