pike.git / lib / modules / Sql.pmod / sql_result.pike

version» Context lines:

pike.git/lib/modules/Sql.pmod/sql_result.pike:1:   /*    * Implements the generic result module of the SQL-interface    *    * Henrik Grubbström 1996-01-09    */      #pike __REAL_VERSION__    - //! Implements the generic result of the SQL-interface. + //! Implements the generic result base class of the SQL-interface.   //! Used for return results from SQL.sql->big_query(). -  + //! + //! You typically don't get a direct clone of this class, + //! but of a class that inherits it, like @[sql_array_result] + //! or @[sql_object_result].      //! The actual result.   mixed master_res;      //! This is the number of the current row. The actual semantics   //! differs between different databases.   int index;      //! Create a new Sql.sql_result object   //!
pike.git/lib/modules/Sql.pmod/sql_result.pike:31:    sprintf("%O(/* row %d/%s, %d field%s */)",    this_program, index,    (!r || index==r && !e)?"?":(string)num_rows(),    f = num_fields(), f!=1?"s":"");   }      //! Returns the number of rows in the result.   int num_rows();      //! Returns the number of fields in the result. - int num_fields() - { -  return master_res->num_fields(); - } + int num_fields();      //! Returns non-zero if there are no more rows.   int eof();      //! Return information about the available fields.   array(mapping(string:mixed)) fetch_fields();      //! Skip past a number of rows.   //!   //! @param skip
pike.git/lib/modules/Sql.pmod/sql_result.pike:64:      //! Fetch the next row from the result.   //!   //! @returns   //! Returns an array with one element per field in the same order as   //! reported by @[fetch_fields()]. See the @[Sql.Sql] class   //! documentation for more details on how different data types are   //! represented.   int|array(string|int|float) fetch_row();    + //! Switch to the next set of results. + //! + //! Some databases support returning more than one set of results. + //! This function terminates the current result and switches to + //! the next (if any). + //! + //! @returns + //! Returns the @[sql_result] object if there were more results, + //! and @expr{0@} (zero) otherwise. + //! + //! @throws + //! May throw the same errors as @[Sql.Sql()->big_query()] et al. + this_program next_result(); +    // --- Iterator API      class _get_iterator   {    protected int|array(string|int) row = fetch_row();    protected int pos = 0;       int index()    {    return pos;