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

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:215: Inside #if constant(SSL.sslfile)
   }       void create(Stdio.File stream, SSL.context ctx) {    rawstream=stream;    std::create(stream,ctx,1,1);    pg::create();    }   }   #endif    - //! The result object returned by @[Sql.pgsql.big_query()], except for + //! The result object returned by @[Sql.pgsql()->big_query()], except for   //! the noted differences it behaves the same as @[Sql.sql_result].   //!   //! @seealso - //! @[Sql.sql_result], @[Sql.pgsql], @[Sql.Sql] + //! @[Sql.sql_result], @[Sql.pgsql], @[Sql.Sql], @[Sql.pgsql()->big_query()]   class pgsql_result {      object _pgsqlsess;   private int numrows;   private int eoffound;   private mixed delayederror;   private int copyinprogress;   int _fetchlimit;   int _alltext;   
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:310:   //! @note   //! This function is PostgreSQL-specific, and thus it is not available   //! through the generic SQL-interface.   int affected_rows() {    int rows;    if(_statuscmdcomplete)    sscanf(_statuscmdcomplete,"%*s %d",rows);    return rows;   }    + //! @seealso + //! @[Sql.sql_result()->num_fields()]   int num_fields() {    return sizeof(_datarowdesc);   }    -  + //! @seealso + //! @[Sql.sql_result()->num_rows()]   int num_rows() {    int numrows;    sscanf(_statuscmdcomplete,"%*s %d",numrows);    return numrows;   }    -  + //! @seealso + //! @[Sql.sql_result()->eof()]   int eof() {    return eoffound;   }    -  + //! @seealso + //! @[Sql.sql_result()->fetch_fields()]   array(mapping(string:mixed)) fetch_fields() {    return _datarowdesc+({});   }      private void releasesession() {    if(_pgsqlsess) {    if(copyinprogress) {    PD("CopyDone\n");    _pgsqlsess._c.sendcmd("c\0\0\0\4",1);    }
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:386: Inside #if undefined(NO_LOCKING)
   }    while(!(_qmtxkey=_pgsqlsess._querymutex.trylock()));   #else    PD("Skipping lock\n");    _qmtxkey=1;   #endif    _pgsqlsess._c.setportal(this);    PD("Stealing successful\n");   }    - //! Returns one result row at a time. + //! @decl array(mixed) fetch_row() + //! @decl void fetch_row(string|array(string) copydatasend)   //! -  + //! @returns + //! One result row at a time. + //!   //! When using COPY FROM STDOUT, this method returns one row at a time   //! as a single string containing the entire row. -  + //! + //! @param copydatasend   //! When using COPY FROM STDIN, this method accepts a string or an   //! array of strings to be processed by the COPY command; when sending   //! the amount of data sent per call does not have to hit row or column   //! boundaries.   //!   //! The COPY FROM STDIN sequence needs to be completed by either   //! explicitly or implicitly destroying the result object, or by passing a   //! zero argument to this method.   //!   //! @seealso   //! @[eof()] - int|array(mixed) fetch_row(void|int|string|array(string) buffer) { + array(mixed) fetch_row(void|int|string|array(string) buffer) {   #ifndef NO_LOCKING    Thread.MutexKey fetchmtxkey = fetchmutex.lock();   #endif    if(!buffer && sizeof(_datarows))    return getdatarow();    if(copyinprogress) {    fetchmtxkey = UNDEFINED;    if(stringp(buffer) || arrayp(buffer)) {    int totalsize=4;    if(arrayp(buffer))