1
votes

There is data family EntityField ent typ which is defined in class PersistEntity ent. I should use it in Filters, SelectOpts and so on. But I can't find a way to get it at runtime. I need something like

data SomeEF e = forall typ. SomeEF { unSomeEF :: EntityField e typ }

and

getEntityFields :: PersistEntity e => e -> [SomeEF]

I need it for instance to make possibility for user define filters or orders dynamically.

Is there exists somewhere?

1

1 Answers

2
votes

No, there's no such function right now. You could write a new TH function that would generate it, or theoretically it could be achieved via Generic deriving, I'm not certain.