I am using express and mysql-native with nodejs. With the mysql-native I stream results from the db row by row like this (in coffee):
exports.getUser = (username,callback) ->
query = mysql.query "select * from users where username = #{username}"
query.on "row", (row)->
callback row
(obviously I would use prepared statements this is an example)
This sort of method won't work with res.render because you cannot be calling the res.render multiple times every time you get a new row
database.getUser "username", (result)->
res.render "people", "data" : result
Is there some other method for sending streamed data or would I have to stream results to the view with sockets?