I have used codegen with slick pg. The generated code throws
could not find implicit value for parameter tt: slick.ast.TypedType[Option[com.vividsolutions.jts.geom.Geometry]]
. I have defined my postgres profile as given at https://github.com/tminglei/slick-pg. Am I missing something here?
Any suggestion on that?
select last_name,
first_name,
(select string_agg(medical_specialty.name, '; ') from medical_specialty join doctor_medical_specialty dms on medical_specialty.id = dms.medical_specialty where dms.doctor = doctor.id) as specialties,
(select string_agg(medical_subspecialty.name, '; ') from medical_subspecialty join doctor_medical_subspecialty dms on medical_subspecialty.id = dms.medical_subspecialty where dms.doctor = doctor.id) as subspecialties,
cell_number,
email_address,
rating,
(select string_agg(hospital.name, '; ') from hospital join doctor_hospital dh on hospital.id = dh.hospital where dh.doctor = doctor.id) as hospitals,
(select string_agg(o.name, '; ') from doctoroffice o where o.doctor = doctor.id) as offices
from doctor
Doctors
.map { doc =>
val specialties =
ManageDoctorsDbActions.specialtiesQuery.filter(_._1 === doc.lookup).map(t => stringAgg(t._2.name, "; "))
(doc, specialties)
}
Doctors
.map { doc =>
val specialties =
stringAgg(ManageDoctorsDbActions.specialtiesQuery.filter(_._1 === doc.lookup).map(t => t._2.name), "; ")
(doc, specialties)
}
import FunctionSymbolExtensionMethods._
val StringAgg = new Library.SqlAggregateFunction("string_agg")
def stringAgg(q: Query[Rep[String], _, Seq], delimiter: String)
(implicit tm: TypedType[Option[String]]): Rep[Option[String]] =
StringAgg.column[Option[String]](q.toNode, LiteralNode(delimiter))
...
Doctors
.map { doc =>
val specialties =
stringAgg(ManageDoctorsDbActions.specialtiesQuery.filter(_._1 === doc.lookup).map(_._2.name), ", ")
(doc, specialties)
}
mode().within
expects ColumnOrdered
but I have a Seq
from the groupBy