Thanks Johannes!<div><br></div><div>Can you make sure this compiles and then add it to the wiki: <a href="http://www.yesodweb.com/show/topic/376">http://www.yesodweb.com/show/topic/376</a></div><div>Let us know if there are any difficulties with the wiki, as it is new software. There are a couple more things we need to add to make it nicer to use.</div>

<div><br></div><div>Greg Weber</div><div><br><div class="gmail_quote">On Sat, Jun 18, 2011 at 11:53 AM, Johannes Hess <span dir="ltr">&lt;<a href="mailto:zerstroyer@googlemail.com">zerstroyer@googlemail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks for the cookbook recipe, i made an example where all the rows<br>
are extracted and converted back to the original datatype, maybe this<br>
is useful for someone else too.<br>
<br>
{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving,<br>
TemplateHaskell, OverloadedStrings #-}<br>
import Database.Persist<br>
import Database.Persist.Base<br>
import Database.Persist.Sqlite<br>
import Database.Persist.GenericSql.Raw<br>
import Control.Monad.IO.Class (liftIO)<br>
import Control.Monad.Loops (whileJust)<br>
import <a href="http://Database.Persist.TH" target="_blank">Database.Persist.TH</a><br>
import Data.Either (rights)<br>
import Data.Text (Text)<br>
<br>
share [mkPersist, mkMigrate &quot;migrateAll&quot;][persist|<br>
Person<br>
   name Text<br>
|]<br>
<br>
main :: IO ()<br>
main = withSqliteConn &quot;:memory:&quot; $ runSqlConn $ do<br>
        runMigration migrateAll<br>
        insert $ Person &quot;Michael Snoyman&quot;<br>
        insert $ Person &quot;Miriam Snoyman&quot;<br>
        insert $ Person &quot;Eliezer Snoyman&quot;<br>
        insert $ Person &quot;Gavriella Snoyman&quot;<br>
        insert $ Person &quot;Greg Weber&quot;<br>
        insert $ Person &quot;Rick Richardson&quot;<br>
        lol &lt;- withStmt &quot;SELECT name FROM \&quot;Person\&quot;;&quot;<br>
([]::[PersistValue]) $ \pop -&gt; whileJust pop<br>
(return.fromPersistValues)<br>
        liftIO $ print (rights lol::[Person])<br>
<br>
_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
</blockquote></div><br></div>