Skip to content

Support nested case classes for CsvRow*coder derivation #45

@Daenyth

Description

@Daenyth

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions