-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve doc about using esqueleto with Yesod #1
Comments
How TO HIDE PERSISTENT? |
Just FYI - what I've done for my project is to split off queries from handlers so that handler can just Then findAFromBWithCount :: TableBId -> SqlPersistT Handler [(Value TableAId, Value (Maybe Int))]
findAFromBWithCount = select $ from $ \(ta `InnerJoin` tb) -> -- etc... The type signatures are unfortunately slightly awkward to maintain (and non-optional) but it helps prevent any overlap with persistent operators. (Perhaps helpers for unboxing |
Bump upper bounds for base and text
@rehno-lindeque I tried that for myself but got an error finding "Handler". The only "Handler" I could find is |
@joefiorini oh the These days I often just add all the type constraints the compiler tells me I need. E.g. getFoo :: (PersistMonadBackend m ~ SqlBackend, MonadResource m, MonadSqlPersist m)
=> m (Entity Foo) The type signatures for esqueleto may have changed now with persistent 2 though and I haven't had a chance to upgrade yet. You may find the ConstraintKind extension helpful: Have a look at the Persistent 2.1 upgrade guide in this blog post |
BTW, since you guys revived this issue, what should be done about it, if anything? :) |
Some beginner-friendly documentation on how to write type signatures for standalone queries perhaps? I think the persistent upgrade doc did a reasonable job of it for persistent. |
I'm using this:
For some reason (^.) doesn't need to be hidden. I'm not sure about the other operators. If there's no more elegant way of hiding persistent, then maybe something like this should be in the docs, as some noob friendly boilerplate. |
On Fri, Sep 7, 2012 at 7:42 AM, Arthur Clemens arthurclemens@gmail.com wrote:
Yesod exports Yesod.Persist, which in turn exports Database.Persist, which in turns exports Database.Persist.Query, which conflicts with a lot of symbols from esqueleto.
Hmm... I guess I'll have to say on the docs that either you manually import Yesod modules, or you import esqueleto qualified.
The text was updated successfully, but these errors were encountered: