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

Support nested case classes for CsvRow*coder derivation #45

Open
Daenyth opened this issue Jul 20, 2020 · 1 comment
Open

Support nested case classes for CsvRow*coder derivation #45

Daenyth opened this issue Jul 20, 2020 · 1 comment
Labels
Milestone

Comments

@Daenyth
Copy link
Contributor

Daenyth commented Jul 20, 2020

When deriving shapeless implicits for very wide case classes, sometimes the compiler fails with a stack overflow error. One technique to avoid this is to nest the case classes, which is isomorphic to the flattened structure.

Something like this:

case class Sub(
  @CsvName("first-name") firstName: String,
  @CsvName("the-age") age: Int
)
case class Whole(
  @CsvName("last-name") lastName: String,
  @CsvEmbed sub: Sub
)
// last-name, first-name, the-age
// flintstone, fred, 42

Context: https://gitter.im/fs2-data/general?at=5f159b91a28d973192e7d07a

Doobie supports a similar structure

@satabin satabin added csv enhancement New feature or request labels Jul 20, 2020
@satabin satabin added this to the 1.0.0 milestone Aug 26, 2020
@satabin
Copy link
Member

satabin commented Aug 26, 2020

Linked to #44.

ybasket added a commit that referenced this issue Mar 2, 2021
Allows to map nested case class structures from and to flat CSV. Fixes #45.
@satabin satabin modified the milestones: 1.0.0, future Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants