-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use nimble_csv everywhere #4183
Conversation
@@ -154,6 +154,7 @@ defmodule PlausibleWeb.StatsController do | |||
Map.keys(csvs) | |||
|> Enum.zip(csv_values) | |||
|> Enum.reject(fn {_k, v} -> is_nil(v) end) | |||
|> Enum.map(fn {k, v} -> {k, IO.iodata_to_binary(v)} end) | |||
|
|||
{:ok, {_, zip_content}} = :zip.create(filename, csvs, [:memory]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self: :zip.create
doesn't support iodata, maybe it makes sense to use zstream here and send the export in chunks.
Hey @ruslandoga I'd like to merge this if possible. Why is it in draft status? |
The main reason is that I thought it would improve performance by using iolists but it turned out to be impossible since |
I'll rebase the PR and remove the Draft tag. |
bce6831
to
62cf5fb
Compare
|
CSV export worked for https://pr-4183.review.plausible.io/dummy.site |
Changes
This PR replaces https://github.com/beatrichartz/csv with https://github.com/dashbitco/nimble_csv as a more performant option (fewer binaries are created this way)
Tests
Changelog
Documentation
Dark mode