javascript - Sails.js stream sql query -


is there way stream data model.query() in sails ?

example

export: (req, res) => {   let sql = "select ...";    let stream = model.query(sql).stream(); // know not work    stream.pipe(...); } 

yes. according sails doc:

module.exports = {    teststream: function(req, res){      if (req.param('startstream') && req.issocket){          var getsocket = req.socket;          // start stream.  pipe sockets.         user.stream({name:'walter'}).pipe(getsocket.emit);      } else {        res.view();      }     } } 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -