I had this stupid idea for quite a long time. PostgreSQL has the COPY command. It is really fast and it is the best way to load CSV like file to the database. So I had an idea: what about not creating an SQL query from an ORM object, but instead generate a CSV file and load it using the COPY?