You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Not in scope error when nesting table per class inheritance #994
changed the title [-]Not in scope error when nesting table er class inheritance[/-][+]Not in scope error when nesting table per class inheritance[/+]on Dec 19, 2019
So the problem is very specifically when the QuasiQuoter is looking up the field type. Something is properly setting the Proxy :: Proxy (TopId -> Int64) in the .Quasi module, but I can't really tell what.
Any thoughts on where to go from here? I'm happy to help, although I admittedly know very little about Template Haskell and quasi quotes.
We are trying to move toward table per class inheritance due to the significant issues with our current approximation of it (lots of joins, extra error possibilities, significantly more key-passing noise). This approach is currently the only way to implement table per class inheritance in persistent.
Activity
[-]Not in scope error when nesting table er class inheritance[/-][+]Not in scope error when nesting table per class inheritance[/+]parsonsmatt commentedon Dec 19, 2019
There's a simpler case:
which fails with a similar "
TopIdnot in scope" error. If I-ddump-splices, I get this output:Output is kinda large, sorry
The problem is in the
Bottom { entityFields = ... }entry.TopIdis being referenced directly here for some reason, instead of aProxy Int64and it'll be set later by the TH machinery. So that's not right!The
ForeignRefstuff is fine, it's just theFieldDefthat is wrong.Cleaning up the
Middle, we get:{ entityFields = [ FieldDef (HaskellName "top") (DBName "id") ((FTTypeCon Nothing) "TopId") (sqlType (Data.Proxy.Proxy :: Data.Proxy.Proxy Int64)) [Data.Text.pack "sql=id"] True (ForeignRef (HaskellName "Top") ((FTTypeCon (Just "Data.Int")) "Int64")) Nothing ] }While
Bottomhas this:{ entityFields = [ FieldDef (HaskellName "middle") (DBName "id") (FTTypeCon Nothing "MiddleId") (sqlType (Data.Proxy.Proxy :: Data.Proxy.Proxy TopId)) [Data.Text.pack "sql=id"] True (ForeignRef (HaskellName "Middle") ((FTTypeCon (Just "Data.Int")) "Int64")) Nothing ]So the problem is very specifically when the
QuasiQuoteris looking up the field type. Something is properly setting theProxy :: Proxy (TopId -> Int64)in the.Quasimodule, but I can't really tell what.tysonzero commentedon Feb 11, 2020
@parsonsmatt
Any thoughts on where to go from here? I'm happy to help, although I admittedly know very little about Template Haskell and quasi quotes.
We are trying to move toward table per class inheritance due to the significant issues with our current approximation of it (lots of joins, extra error possibilities, significantly more key-passing noise). This approach is currently the only way to implement table per class inheritance in persistent.
parsonsmatt commentedon Feb 14, 2020
#1042 is a conglomerate issue to track failures of key/id lookups