I have a postgres table -
CREATE TABLE "Contest"
(
id serial NOT NULL,
name varchar(100) NOT NULL,
type char(1) NOT NULL,
status char(1) NOT NULL,
...
)
I'm trying to get field values type
and status
back to my Play 2.x (Anorm) application:
val parseContest = {
get[Pk[Int]]("id") ~
get[String]("name") ~
get[Char]("type") ~
get[Char]("status") map {
case id~name~c_type~status =>
Contest(id, name, c_type, status)
}
}
and get error:
could not find implicit value for parameter extractor: anorm.Column[Char]
Looks like 'Char' is not supported by anorm.
What should I change in my code? Is it good practice to use get[String]("status")
and then status.head
as workaround?