Closed romulogarofalo closed 1 year ago
Hi @romulogarofalo! Thanks for the PR!
I don't want to encourage this option because doing so dynamically like this is likely way less performant than doing it as part of your encoding. For example, if you have a user, it is better to write:
users
|> Stream.map(fn x -> [x.name, x.address] end)
|> to_csv(...)
Then pass options that will sort it dynamically later on. :)
Add headers options to
dump_to_iodata
anddump_to_stream
function to order the columnsthe same option as the CSV lib CSV.encode/2
the motivation was because of migrate from the CSV lib to Nible (because of performance problems) and this option was really useful from the old lib