question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

could not find implicit value for parameter f: slick.jdbc.GetResult[com.vividsolutions.jts.geom.Point]

See original GitHub issue

I am trying to run a custom query in Slick and map the result to a custom case class as follows:

case class BusinessDistanceResult(businessId: Long, userId: String, name: String, location: Point, address: Option[String], phonenumber: Option[String], email: Option[String], distance: Float )

  object BusinessDistanceResult {


    implicit val getMyMatch = GetResult(r => BusinessDistanceResult(r.<<, r.<<, r.<<, r.<<[Point], r.<<, r.<<, r.<<, r.<<))

  }

And here is my Query

def businessNearLocation(locationRadiusInput: LocationRadiusInput) =
      sql"""SELECT businessId, userId, name, location, address, phonenumber, email, ST_Distance(location, ref_geom) AS distance
           |FROM business
           |CROSS JOIN (SELECT ST_MakePoint(${locationRadiusInput.longitude}, ${locationRadiusInput.latitude})::geography AS ref_geom) AS r
           |WHERE ST_DWithin(location, ref_geom, ${locationRadiusInput.radius})
           |ORDER BY ST_Distance(location, ref_geom)""".as[BusinessDistanceResult]

However It is throwing the compilation Error:

could not find implicit value for parameter f: slick.jdbc.GetResult[com.vividsolutions.jts.geom.Point]
[error]     implicit val getMyMatch = GetResult(r => BusinessDistanceResult(r.<<, r.<<, r.<<, r.<<[Point], r.<<, r.<<, r.<<, r.<<))

But from my understanding, this implicit conversion should of been taken care of the implicits I declared in my class:

object MyAPI extends API with ArrayImplicits
    with DateTimeImplicits
    with JsonImplicits
    with NetImplicits
    with LTreeImplicits
    with RangeImplicits
    with HStoreImplicits
    with SearchImplicits
    with PostGISImplicits
    with PostGISAssistants

Is there something I am missing?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tmingleicommented, Aug 25, 2017

Well, you didn’t provide all the details. Maybe you can check the PgPostGISSupportSuite, which is a full and working case.

0reactions
tmingleicommented, Aug 26, 2017

Glad to hear that! You’re welcome! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slick 3.0.3 error: could not find implicit value for parameter rconv
I have the model as Tables.scala generated with Slick 3.0.3 that includes the GetResult implicit conversion from a result set for all my...
Read more >
Could not find implicit value for parameter tt: slick.ast ... - GitHub
I'm new to scala and I'm trying to integrate a PostgreSQL database to a Lagom application written in scala.I'm trying to utilise the...
Read more >
[Solved]-Slick: could not find implicit value for parameter e ...
Coding example for the question Slick: could not find implicit value for parameter e: slick.jdbc.SetParameter[Option[java.util.UUID]]-postgresql.
Read more >
Implicit Resolution Gotcha - Abhishek's Tech Dojo
While working on Slick and interesting scenario of implicit resolution ... could not find implicit value for parameter rconv: slick.jdbc.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found