Skip to content
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

Added to_pgxlsx and to_pgcsv support #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MedinsT
Copy link
Member

@MedinsT MedinsT commented Jun 5, 2019

No description provided.

@MedinsT MedinsT requested a review from ebeigarts June 5, 2019 10:59
@@ -13,6 +13,36 @@ def to_xlsx(&block)
to_file(formatter, &block)
end

def to_pgxlsx
formatter = Xport::Axlsx::Formatter.new(self)
Copy link
Member

@ebeigarts ebeigarts Jun 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be really great if this could be used with any formatter - axlsx, xlsxtream, csv, etc.

module PostgresCopy
    def write_body(formatter, worksheet)
       ....
    end

    def to_csv
       ....
    end
end

and then we could use

class UserExport < Xport::Export
  include Xport::Axlsx
  include Xport::PostgresCopy # can be used for csv and excel

Also test would be very nice addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants