Skip to content

Expr Ops not handling variance (opaque types) #104

@ivan-klass

Description

@ivan-klass

Currently we have:

override implicit def ExprStringOpsConv(v: Expr[String]): PostgresDialect.ExprStringOps[String] =
    new PostgresDialect.ExprStringOps(v)

So methods .contains or .like are not picked up for refined string:

opaque type PetName <: String = String


// fails
Pet.select.filter(_.name.contains("ffy"))

I believe this could be easily fixed with something like

override implicit def ExprStringOpsConv[V <: String](v: Expr[V]): PostgresDialect.ExprStringOps[V] =
    new PostgresDialect.ExprStringOps(v)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions