kebs icon indicating copy to clipboard operation
kebs copied to clipboard

Add support for slickpg column extensions with ValueClassLike and InstanceConverter

Open mielnikk opened this issue 2 years ago • 1 comments

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]

mielnikk avatar Apr 19 '23 09:04 mielnikk

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.: https://github.com/theiterators/kebs/blob/fb10a1ba572a1dacd8e3ad6bd2940013a5260295/slick/src/main/scala/pl/iterators/kebs/slick/KebsSlickSupport.scala#L15

luksow avatar Sep 17 '24 16:09 luksow