3

We are having a few issues managing images in the database with Slick. They are stored in a Array[Byte] format. Every source I read informs me it should work, but I keep getting this error:

could not find implicit value for parameter conv: scala.slick.jdbc.GetResult[Array[Byte]]

The compiler is telling me that no mapper is found for Array[Byte]. I must be missing a simple import, but I can't seem to find it.

2
  • Please also add the query you are using. Commented Jun 15, 2013 at 4:31
  • Here is the query I execute: Q.queryNA[Array[Byte]]("SELECT image FROM images WHERE id = 1") Commented Jun 15, 2013 at 7:48

1 Answer 1

3

You need an implicit GetResult in scope to map from the db result to the Array[Byte] that you want. Try adding the following just before your query:

implicit val GetByteArr = GetResult(r => r.nextBytes)
Sign up to request clarification or add additional context in comments.

1 Comment

Hi, thanks for the response. Because of the deadline, we took the easy way out of saving the bytes as a file. We might use your input in the near future, when we have more time. Thanks again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.