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

ColumnMapper for case classes #145

Open
nMoncho opened this issue Aug 31, 2024 · 0 comments
Open

ColumnMapper for case classes #145

nMoncho opened this issue Aug 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nMoncho
Copy link
Owner

nMoncho commented Aug 31, 2024

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] = ???
}
@nMoncho nMoncho added the enhancement New feature or request label Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant