Skip to content

ColumnMapper for case classes #145

@nMoncho

Description

@nMoncho

Not every nested case class should be a UDT. Some case classes could be mapped to columns, they could be flatten.

Consider the example:

case class Bar(name: String, age: Int)
case class Foo(id: UUID, bar: Bar)

This could be mapped as:

CREATE TABLE foos (id UUID, bar_name  TEXT, bar_age  INT)

We want to introduce a way to create a ColumnMapper that can make this mapping possible. At a high level this method should look like:

object ColumnMapper {
  def of[T](prefix: String = "", renames: T => (Any, ColumnName)*): ColumnMapper[T] = ???
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions