-
Notifications
You must be signed in to change notification settings - Fork 16
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
Yesod #13
Comments
I just tried this and it looks like you would need to add at least these extra dependencies to stack.yaml and then run "stack build". extra-deps:
Let me know if you need more info. |
How can I implement YesodPersist in Yesod? I tryed the following which doesn't compile:
For instance, I've found the following code from the Yesod book:
|
stack new abcd yesod-simple [ie create project with yesod-simple template just to setup all yesod dependencies] then add these dependencies to the abcd.cabal file add these extra dependencies to stack.yaml
run: stack build Create this file: I dont have MySql on my machine so I used sqlite3 instead but it is similar: A minor thing, : but I noticed that you had: {-# LANGUAGE EmptyDataDecls #-} share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| data App = App instance YesodPersist App where instance YesodPersistRunner App where mkYesod "App" [parseRoutes| getHomeR :: Handler TypedContent
blogsSrc $= CL.map ((E.Value blogid, E.Value title, E.Value name) -> toFlushBuilder $ [hamlet| getBlogR :: BlogId -> Handler Html main :: IO ()
warp 3000 App |
It is working! Run from outside a project, using implicit global project config getColumns cs=[Right (Left (Column {cName = DBName {unDBName = "name"}, cNull = False, cSqlType = SqlString, cDefault = Nothing, cDefaultConstraintName = Nothing, cMaxLen = Nothing, cReference = Nothing}))] us=[] old=[Right (Left (Column {cName = DBName {unDBName = "name"}, cNull = False, cSqlType = SqlString, cDefault = Nothing, cDefaultConstraintName = Nothing, cMaxLen = Nothing, cReference = Nothing}))] fdefs=[] getColumns cs=[Right (Left (Column {cName = DBName {unDBName = "author"}, cNull = False, cSqlType = SqlInt64, cDefault = Nothing, cDefaultConstraintName = Nothing, cMaxLen = Nothing, cReference = Nothing})),Right (Left (Column {cName = DBName {unDBName = "title"}, cNull = False, cSqlType = SqlString, cDefault = Nothing, cDefaultConstraintName = Nothing, cMaxLen = Nothing, cReference = Nothing})),Right (Left (Column {cName = DBName {unDBName = "content"}, cNull = False, cSqlType = SqlString, cDefault = Nothing, cDefaultConstraintName = Nothing, cMaxLen = Nothing, cReference = Nothing}))] us=[] old=[Right (Left (Column {cName = DBName {unDBName = "author"}, cNull = False, cSqlType = SqlInt64, cDefault = Nothing, cDefaultConstraintName = Nothing, cMaxLen = Nothing, cReference = Nothing})),Right (Left (Column {cName = DBName {unDBName = "title"}, cNull = False, cSqlType = SqlString, cDefault = Nothing, cDefaultConstraintName = Nothing, cMaxLen = Nothing, cReference = Nothing})),Right (Left (Column {cName = DBName {unDBName = "content"}, cNull = False, cSqlType = SqlString, cDefault = Nothing, cDefaultConstraintName = Nothing, cMaxLen = Nothing, cReference = Nothing}))] fdefs=[] |
Unfortunately I don't have mysql and am unable to debug this. |
Hello gbway, I am following another path. I am trying to integrate persistent-odbc with scotty, looking at this tutorial: http://adit.io/posts/2013-04-15-making-a-website-with-haskell.html tutorial version using Postgrees:
but I am getting trouble in the following code:
But the signature doesn't match... |
How can I easily use it with yesod through stack? (By the way, thank you so much for this repo, it was the only way I've found to use Persistent+Mysql+Windows)
The text was updated successfully, but these errors were encountered: