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

Add support for slickpg column extensions with ValueClassLike and InstanceConverter #276

Open
mielnikk opened this issue Apr 19, 2023 · 1 comment

Comments

@mielnikk
Copy link
Contributor

Using a tagged type

@tagged trait Domain {

  trait UserEmailTag
  type UserEmail = String @@ UserEmailTag
}

object UserDomain extends Domain {}

with PgStringSupport produces the following error:

value ilike is not a member of slick.lifted.Rep[mypackage.UserDomain.UserEmail]
@luksow
Copy link
Contributor

luksow commented Sep 17, 2024

Ok, I'm reclassifying this as an enhancement. This is because ilike is defined in slick-pg extensions.: https://github.com/tminglei/slick-pg/blob/master/core/src/main/scala/com/github/tminglei/slickpg/str/PgStringExtensions.scala#L32

There're many column extensions in slick-pg, so I propose to create a new kebs module kebs-slick-pg that would show mapping between various ValueClassLike (and InstanceConverter) and slick-pg's extension methods. A quick glance what would be useful is here: https://github.com/search?q=repo%3Atminglei%2Fslick-pg+Extensionmethods&type=code&p=1

This should be very easy, see e.g.:

implicit def stringValueColumnExt[CC](rep: Rep[CC])(implicit @unused ev: ValueClassLike[CC, String]): StringColumnExtensionMethods[CC] =

@luksow luksow changed the title Slick String extensions don't see tagged types Add support for slickpg column extensions with ValueClassLike and InstanceConverter Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants