在ghci中加载scaffolded站点后获取runDB的正确实例是什么?例如,在运行这句话时:
runDB $ selectList [UserName ==. "Renny"] []
Run Code Online (Sandbox Code Playgroud)
错误是:
Couldn't match type `PersistMonadBackend
(YesodPersistBackend site0 (HandlerT site0 IO))'
with `persistent-1.3.0.6:Database.Persist.Sql.Types.SqlBackend'
The type variable `site0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Expected type: PersistMonadBackend
(YesodPersistBackend site0 (HandlerT site0 IO))
Actual type: PersistEntityBackend User
In the second argument of `($)', namely
`selectList [UserName ==. "Renny"] []'
In the expression: runDB $ selectList [UserName ==. "Renny"] []
In an equation for `it':
it = runDB $ …Run Code Online (Sandbox Code Playgroud)