I need to map json values to the table using slick and store whole json as a blob in the same table as well.
def createJob(jobs: JobEntity): Future[Option[Long]] =
db.run(job returning job.map((_.id)) += jobs)
My Json contains values like
id(long),name(string), type(string)
while the table I am trying to map has columns
id(long),name(string), type(string),json_data(blob)
I have JobEntity class as
case class JobEntity(id: Option[Long] = None, name: String, type: String) {
require(!jobname.isEmpty, "jobname.empty")
}
How do I map the json to the json_data column?