I have a file with two columns and I would like to filter based off the rows of the list.
In C# with NHibernate, I would fold the Linq expression tree. I'm struggling with io.getquill's tree as it seems as if it relies on macro expansion a lot and can't handle runtime evaluations.
inline def quotedIndividual(pncnPair: PNCNPair) = quote {
(pr: PatientRegistration.PatientRegistration, cn: CaseRegistration.CaseRegistration) =>
pr.PatientNumber == lift(pncnPair.patientNumber) && cn.CaseNumber == lift(pncnPair.caseNumber)
}
val totalORClauses = quote {
(pr: PatientRegistration.PatientRegistration, c: CaseRegistration.CaseRegistration) =>
pncnPairs.foldLeft(lift(true))((accum, pncnPair) => accum || quotedIndividual(pncnPair)(pr, c))
}
If I try to perform this, the compiler gives an error with "s==== Tree cannot be parsed to 'Ast' ===="
The io.getquill website doesn't appear to have much examples of expression tree folding so that the WHERE clause filters by what's exactly found in the two column file I have.