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

Generic GetResult Encoder #1630

Open
mantovani opened this issue Jun 24, 2022 · 1 comment
Open

Generic GetResult Encoder #1630

mantovani opened this issue Jun 24, 2022 · 1 comment

Comments

@mantovani
Copy link

Would be really good if we could do:

import slick.jdbc.GetResult.Generic
 
case class Company(id: Long, name: String, countryId: Option[Long])

sql"SELECT 1,2,3".as[Company]

Today we have to manually create an encoder for each case class. Would be great if we had a generic encoder like Doobie does.

https://tpolecat.github.io/doobie/docs/04-Selecting.html

@seratch
Copy link
Member

seratch commented Jun 25, 2022

Hi @mantovani, you can use autoConstruct macro for this! http://scalikejdbc.org/documentation/auto-macros.html

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

No branches or pull requests

2 participants