It is easy to run DB actions in a regular Handler workflow, as the runDB function can be used to convert SqlPersistM actions to Handler .
But there is no way to convert SqlPersistM directly into IO using the default application settings. If you look at Foundation.hs as defined in the application scaffold, there is the following instance
instance YesodPersist App where type YesodPersistBackend App = SqlBackend runDB action = do master <- getYesod runSqlPool action $ appConnPool master instance YesodPersistRunner App where getDBRunner = defaultGetDBRunner appConnPool
which mainly uses runSqlPool with application configuration, but I don't see an easy way to use this to access the configuration form in REPL.
TL DR: What I'm looking for is to just do something like runDB $ selectList [...] [...] from within the Kabbalah replacement in my Yesod application without duplicating the settings that make esod scaffolding out of the box.
source share