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
persistent is a pretty big project and it would be nice if there was a way to define a types package, share it between GHC backend and GHCJS frontend without GHCJS depending on persistent. Also I found that some versions of persistent have trouble compiling with GHCJS. Ideally there could be a way to declare your models as types first and then apply a version of mkPersist to an existing type and produce all of the necessary persistent typeclasses and functions on the GHC side only and don't reproduce . Conceptually I don't think it is too challenging but there are a few things from persistent that need to be shared on both sides, namely Entity, Key and Id. Perhaps we could have a small base package that defines these, then the GHCJS package and the main persistent package can import them, but I am not sure how challenging it would be to pull those out.
(For reference, this was also an issue mentioned on groundhog lykahb/groundhog#53)
The text was updated successfully, but these errors were encountered:
This is certainly not the first time this approach has been proposed. Its tough to find a satisfactory solution here, particularly around adding meta-data annotations. But I think it would be great to have an alternate way to declare as you are suggesting.
persistent is a pretty big project and it would be nice if there was a way to define a types package, share it between GHC backend and GHCJS frontend without GHCJS depending on persistent. Also I found that some versions of persistent have trouble compiling with GHCJS. Ideally there could be a way to declare your models as types first and then apply a version of
mkPersist
to an existing type and produce all of the necessary persistent typeclasses and functions on the GHC side only and don't reproduce . Conceptually I don't think it is too challenging but there are a few things from persistent that need to be shared on both sides, namelyEntity
,Key
andId
. Perhaps we could have a small base package that defines these, then the GHCJS package and the main persistent package can import them, but I am not sure how challenging it would be to pull those out.(For reference, this was also an issue mentioned on groundhog lykahb/groundhog#53)
The text was updated successfully, but these errors were encountered: