as I'm very new to Haskell, could someone kindly push me into the correct direction of solving the following problem...?
I started with Yesod's scaffolding application. Serving HTML generated from database content works fine, but is there an elegant way to create plain text responses iterating over database tables? Simple plain text using a Handler like
getTestR = return . RepPlain . toContent ...
works too, but I'd like to serve:
config/models:
File
path Text
Conf
key Text
val Text
file FileId
as plaintext as in the SQL query:
select path, key, val from file, conf order by path, key;
As hamlet is for generating HTML, I think I must generate the response (iterate over the database contents) entirely in Haskell?
How do I convert between a database Entity and a Text (or Int, if the Row is of type Int), how do I convert from and to a database column Id?