I’m attempting to replicate an INSERT … SELECT in Ecto. This appears to be supported by both postgres and mysql (I’m using postgres). I’ve got this working in SQL, but trying to recreate in Ecto.Query.
I created an ecto query that returns the data I want, and tried passing it to
insert_all and both seemed to cause errors.
Is there a supported method to do this, or is the official answer, “just use sql”?
I found this post that didn’t really answer the question from Aug 2018: Execute Insert_all from a select