Branch: Tag:

2018-01-25

2018-01-25 15:31:49 by Stephen R. van den Berg <srb@cuci.nl>

Sql.Promise: Add support for eventbased mapping of resultrows.

1233:   //! @seealso   //! @[big_typed_query()], @[Sql.Promise], @[Sql.FutureResult]   //! + //! @param map_cb + //! + //! Callback function which is called for every row returned. + //! First parameter is the row, second parameter is the result object + //! being processed, and the third parameter is the array of result rows + //! already collected so far. The function should return the modified + //! version of the row that needs to be stored, or it should return + //! @expr{0@} to discard the row. + //!   //! @example   //! @code   //!
1265:   //! resp->status_command_complete);   //! });   //! @endcode - public .Promise promise_query(string q, -  void|mapping(string|int:mixed) bindings) { -  return __builtin.Sql.Promise(this, q, bindings); + public variant .Promise promise_query(string q, +  void|mapping(string|int:mixed) bindings, +  void|function(array, .Result, array :array) map_cb) { +  return __builtin.Sql.Promise(this, q, bindings, map_cb);   } -  + public variant .Promise promise_query(string q, +  function(array, .Result, array :array) map_cb) { +  return __builtin.Sql.Promise(this, q, 0, map_cb); + }