DEV Community


Discussion on: Generating and Downloading CSV files using express JS

spilex profile image
Alex Solonenko

Actually, I'm not a Front End dev, and my knowledge of js and node is quite a little, but I can help you to improve your solution.
Postgres has a very nice feature called "COPY FROM". It can copy any data from your database in the CSV format with the header as well.
So basically you don't need to have a json_to_converter and any orm at all.
Just using the "COPY TO STDOUT" and js streams you are able to build a very powerful and nice solution, which will help you to get any data from the database no matter how it will be large in size. you will be limited only with your bandwidth.

davidokonji profile image
David Okonji Author

Thank you, Alex, Yeah sure an ORM is not necessary, I would surely try out the alternate solution suggested.