pike.git / lib / modules / __builtin.pmod / Sql.pmod / FutureResult.pike

version» Context lines:

pike.git/lib/modules/__builtin.pmod/Sql.pmod/FutureResult.pike:12:   #define PD(X ...) 0   #define PT(X ...) (X)   #endif      //! The promise result class; it will contain the results of a query.   //!   //! @seealso   //! @[Promise], @[Connection.promise_query()]      //! The returned raw unadorned records, all typed data. - //! Once @[data] has been accessed, @[raw_data] + //! Once @[get()] has been accessed, @[data]   //! will point to the same adorned records.   //!   //! @seealso   //! @[Sql.Connection->big_typed_query()] - final array(mixed) raw_data; + final array(mixed) data;    -  + //! @returns   //! The returned labeled records, all typed data.   //!   //! @seealso - //! @[Sql.Connection->query()], @[raw_data] - final array(mapping(string:mixed)) `data() { + //! @[Sql.Connection->query()], @[data] + final array(mapping(string:mixed)) get() {    if (_dblink) { -  raw_data = _dblink->res_obj_to_array(raw_data, fields); +  data = _dblink->res_obj_to_array(data, fields);    _dblink = 0;    } -  return raw_data; +  return data;   }      //! The SQL query.   final string query;      //! The parameter bindings belonging to the query.   final mapping(string:mixed) bindings;      //! The status of the completed command.   //! If the command is still in progress, the value is @expr{null@}.
pike.git/lib/modules/__builtin.pmod/Sql.pmod/FutureResult.pike:56:   final array(mapping(string:mixed)) fields;      final .Connection _dblink;      protected string _sprintf(int type) {    string res;    switch(type) {    case 'O':    res = sprintf("FutureResult from query: %O, bindings: %O\n"    "recordcount: %d", -  query, bindings, sizeof(raw_data)); +  query, bindings, sizeof(data));    break;    }    return res;   }      protected    void create(.Connection db, string q, mapping(string:mixed) bindings) {    PD("Create future result %O %O %O\n", db, q, bindings);    query = q;    this::bindings = bindings; -  raw_data = ({}); +  data = ({});    _dblink = db;   }      #ifdef SP_DEBUG   protected void _destruct() {    PD("Destroy result %O %O\n", query, bindings);   }   #endif