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

version» Context lines:

pike.git/lib/modules/__builtin.pmod/Sql.pmod/Connection.pike:563:   //! @param q   //! Query to send to the SQL-server. This can either be a string with the   //! query, or a previously compiled query (see @[compile_query()]).   //!   //! @returns   //! The result is returned as an @[Sql.Result] object in untyped   //! mode. This allows for having some more info about the result as   //! well as processing the result in a streaming fashion, although the   //! result itself wasn't obtained streamingly from the server.   //! - //! Returns @expr{0@} if the query didn't return any result - //! (e.g. @tt{INSERT@} or similar). - //! +    //! @throws   //! Throws an exception if the query fails.   //!   //! Called by other variants of @[big_query()] after they have processed   //! their extra arguments.   //!   //! This prototype function is the base variant and is intended to be   //! overloaded by actual drivers.   //!   //! @note   //! Despite the name, this function is not only useful for "big"   //! queries. It typically has less overhead than @[query] also for   //! ones that return only a few rows.   //!   //! @seealso   //! @[query], @[streaming_query] - int|.Result big_query(object|string q); + variant .Result big_query(object|string q);      //! Send an SQL query synchronously to the SQL-server and return   //! the results in untyped mode.   //!   //! @param q   //! Query to send to the SQL-server. This can either be a string with the   //! query, or a previously compiled query (see @[compile_query()]).   //!   //! @param bindings   //! A mapping containing bindings of variables used in the query.
pike.git/lib/modules/__builtin.pmod/Sql.pmod/Connection.pike:611:   //! @endcode   //!   //! Binary values (BLOBs) may need to be placed in multisets.   //!   //! @returns   //! The result is returned as an @[Sql.Result] object in untyped   //! mode. This allows for having some more info about the result as   //! well as processing the result in a streaming fashion, although the   //! result itself wasn't obtained streamingly from the server.   //! - //! Returns @expr{0@} if the query didn't return any result - //! (e.g. @tt{INSERT@} or similar). - //! +    //! @throws   //! Throws an exception if the query fails.   //!   //! Calls the base variant of @[big_query()] after having inserted   //! the bindings into the query (using @[emulate_bindings()]).   //!   //! Drivers that actually support bindings should overload this   //! variant in addition to the base variant.   //!   //! @note   //! Despite the name, this function is not only useful for "big"   //! queries. It typically has less overhead than @[query] also for   //! ones that return only a few rows.   //!   //! @seealso   //! @[query], @[emulate_bindings], @[streaming_query] - variant int|.Result big_query(object|string q, + variant .Result big_query(object|string q,    mapping(string|int:mixed) bindings)   {    return big_query(emulate_bindings(q, bindings));   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results in untyped mode.   //!   //! @param q   //! Query to send to the SQL-server. This can either be a string with the
pike.git/lib/modules/__builtin.pmod/Sql.pmod/Connection.pike:655:   //! Arguments as you would use in sprintf. They are automatically   //! quoted.   //!   //! @code   //! res = query("select foo from bar where gazonk=%s","value");   //! @endcode   //!   //! The result is returned as an @[Sql.Result] object in untyped   //! mode. This allows for having some more info about the result as   //! well as processing the result in a streaming fashion, although the - //! result itself wasn't obtained streamingly from the server. Returns - //! @expr{0@} if the query didn't return any result (e.g. @tt{INSERT@} - //! or similar). + //! result itself wasn't obtained streamingly from the server.   //!   //! The default implementation normalizes @[q] and @[extraargs] to   //! use the bindings mapping (via @[handle_extraargs()]), and calls   //! one of the other variants of @[big_query()] with the result.   //!   //! @note   //! Despite the name, this function is not only useful for "big"   //! queries. It typically has less overhead than @[query] also for   //! ones that return only a few rows.   //!   //! @seealso   //! @[query], @[handle_extraargs], @[streaming_query] - variant int|.Result big_query(object|string q, + variant .Result big_query(object|string q,    string|multiset|int|float|object extraarg,    string|multiset|int|float|object ... extraargs)   {    return big_query(@handle_extraargs(q, ({ extraarg }) + extraargs));   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results in untyped mode.   //!   //! For the arguments, please see the @[big_query()] function.
pike.git/lib/modules/__builtin.pmod/Sql.pmod/Connection.pike:717:   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results in typed mode.   //!   //! For the argument, please see the @[big_query()] function.   //!   //! The result is returned as an @[Sql.Result] object in typed   //! mode. This allows for having some more info about the result as   //! well as processing the result in a streaming fashion, although the - //! result itself wasn't obtained streamingly from the server. Returns - //! @expr{0@} if the query didn't return any result (e.g. @tt{INSERT@} - //! or similar). + //! result itself wasn't obtained streamingly from the server.   //!   //! @note   //! Typed mode is not supported by all sql databases. If not   //! supported, an error is thrown.   //!   //! @note   //! Despite the name, this function is not only useful for "big"   //! queries. It typically has less overhead than @[typed_query] also   //! for ones that return only a few rows.   //!   //! Called by @[big_typed_query()] after it has processed any bindings.   //! - //! This prototype function is intended for overriding by drivers. + //! Drivers should override this prototype function.   //!   //! @seealso   //! @[query], @[typed_query], @[big_query], @[streaming_query] - int|.Result big_typed_query(object|string q); + variant .Result big_typed_query(object|string q);      //! Send an SQL query synchronously to the SQL-server and return   //! the results in typed mode.   //!   //! For the arguments, please see the @[big_query()] function.   //!   //! The result is returned as an @[Sql.Result] object in typed   //! mode. This allows for having some more info about the result as   //! well as processing the result in a streaming fashion, although the - //! result itself wasn't obtained streamingly from the server. Returns - //! @expr{0@} if the query didn't return any result (e.g. @tt{INSERT@} - //! or similar). + //! result itself wasn't obtained streamingly from the server.   //!   //! @note   //! Typed mode is not supported by all sql databases. If not   //! supported, an error is thrown.   //!   //! @note   //! Despite the name, this function is not only useful for "big"   //! queries. It typically has less overhead than @[typed_query] also   //! for ones that return only a few rows.   //!   //! Called by @[big_typed_query()] after it has processed any bindings.   //!   //! @seealso   //! @[query], @[typed_query], @[big_query], @[streaming_query] - variant int|.Result big_typed_query(object|string q, + variant .Result big_typed_query(object|string q,    mapping(string|int:mixed) bindings)   {    return big_typed_query(emulate_bindings(q, bindings));   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results in typed mode.   //!   //! For the arguments, please see the @[big_query()] function.   //!   //! The result is returned as an @[Sql.Result] object in typed   //! mode. This allows for having some more info about the result as   //! well as processing the result in a streaming fashion, although the - //! result itself wasn't obtained streamingly from the server. Returns - //! @expr{0@} if the query didn't return any result (e.g. @tt{INSERT@} - //! or similar). + //! result itself wasn't obtained streamingly from the server.   //!   //! @note   //! Typed mode is not supported by all sql databases. If not   //! supported, an error is thrown.   //!   //! @note   //! Despite the name, this function is not only useful for "big"   //! queries. It typically has less overhead than @[typed_query] also   //! for ones that return only a few rows.   //!   //! @seealso   //! @[query], @[typed_query], @[big_query], @[streaming_query] - variant int|.Result big_typed_query(object|string q, + variant .Result big_typed_query(object|string q,    string|multiset|int|float|object extraarg,    string|multiset|int|float|object ... extraargs)   {    return big_typed_query(@handle_extraargs(q, ({ extraarg }) + extraargs));   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results in typed mode.   //!   //! For the arguments, please see the @[query()] function.
pike.git/lib/modules/__builtin.pmod/Sql.pmod/Connection.pike:840:   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results streaming in untyped mode.   //!   //! For the arguments, please see the @[low_big_query()] function.   //!   //! The result is returned as a streaming @[Sql.Result] object in   //! untyped mode. This allows for having results larger than the   //! available memory, and returning some more info about the result. - //! Returns @expr{0@} if the query didn't return any result (e.g. - //! INSERT or similar). For the other arguments, they are the same as + //! For the other arguments, they are the same as   //! for the @[query()] function.   //!   //! Called by @[streaming_query()] after it has processed any bindings.   //! - //! This variant function is intended for overriding by drivers. + //! Drivers should override this prototype function.   //!   //! @note   //! Streaming operation is not supported by all sql databases.   //! The default implementation falls back to calling @[big_query()].   //!   //! @seealso   //! @[big_query], @[streaming_typed_query] - int|.Result streaming_query(object|string q) + variant .Result streaming_query(object|string q)   {    return big_query(q);   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results streaming in untyped mode.   //!   //! For the arguments, please see the @[low_big_query()] function.   //!   //! The result is returned as a streaming @[Sql.Result] object in   //! untyped mode. This allows for having results larger than the   //! available memory, and returning some more info about the result. - //! Returns @expr{0@} if the query didn't return any result (e.g. - //! INSERT or similar). For the other arguments, they are the same as + //! For the other arguments, they are the same as   //! for the @[query()] function.   //!   //! Called by @[streaming_query()] after it has processed any bindings.   //! - //! This variant function is intended for overriding by drivers that - //! actually implement bindings. + //! Drivers that implement bindings should override this prototype function.   //!   //! @note   //! Streaming operation is not supported by all sql databases.   //! The default implementation falls back to calling @[big_query()].   //!   //! @seealso   //! @[big_query], @[streaming_typed_query] - variant int|.Result streaming_query(object|string q, + variant .Result streaming_query(object|string q,    mapping(string:mixed) bindings)   {    return streaming_query(emulate_bindings(q, bindings));   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results streaming in untyped mode.   //!   //! For the arguments, please see the @[query()] function.   //!   //! The result is returned as a streaming @[Sql.Result] object in   //! untyped mode. This allows for having results larger than the   //! available memory, and returning some more info about the result. - //! Returns @expr{0@} if the query didn't return any result (e.g. - //! INSERT or similar). For the other arguments, they are the same as + //! For the other arguments, they are the same as   //! for the @[query()] function.   //!   //! @note   //! Streaming operation is not supported by all sql databases.   //! If not supported, this function will fall back to calling   //! @[big_query()].   //!   //! @seealso   //! @[big_query], @[streaming_typed_query] - variant int|.Result streaming_query(object|string q, + variant .Result streaming_query(object|string q,    string|multiset|int|float|object extraarg,    string|multiset|int|float|object ... extraargs)   {    return streaming_query(@handle_extraargs(q, ({ extraarg }) + extraargs));   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results streaming in typed mode.   //!   //! For the arguments, please see the @[query()] function.   //!   //! The result is returned as a streaming @[Sql.Result] object in   //! typed mode. This allows for having results larger than the   //! available memory, and returning some more info about the result. - //! Returns @expr{0@} if the query didn't return any result (e.g. - //! INSERT or similar). +    //! - //! +    //! Called by @[streaming_query()] after it has processed any bindings.   //! - //! This function is intended for overriding by drivers. + //! Drivers should override this prototype function.   //!   //! @note   //! Neither streaming operation nor typed results are supported   //! by all sql databases. The default implentation falls back to   //! calling @[big_typed_query()].   //!   //! @seealso   //! @[streaming_query], @[big_typed_query] - int|.Result streaming_typed_query(object|string q) + variant .Result streaming_typed_query(object|string q)   {    return big_typed_query(q);   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results streaming in typed mode.   //!   //! For the arguments, please see the @[query()] function.   //!   //! The result is returned as a streaming @[Sql.Result] object in   //! typed mode. This allows for having results larger than the   //! available memory, and returning some more info about the result. - //! Returns @expr{0@} if the query didn't return any result (e.g. - //! INSERT or similar). +    //!   //!   //! Called by @[streaming_query()] after it has processed any bindings.   //! - //! This function is intended for overriding by drivers. + //! Drivers should override this prototype function.   //!   //! @note   //! Neither streaming operation nor typed results are supported   //! by all sql databases. The default implentation falls back to   //! calling @[low_big_typed_query()].   //!   //! @seealso   //! @[streaming_query], @[big_typed_query] - variant int|.Result streaming_typed_query(object|string q, + variant .Result streaming_typed_query(object|string q,    mapping(string|int:mixed) bindings)   {    return streaming_typed_query(emulate_bindings(q, bindings));   }      //! Send an SQL query synchronously to the SQL-server and return   //! the results streaming in typed mode.   //!   //! For the arguments, please see the @[query()] function.   //!   //! The result is returned as a streaming @[Sql.Result] object in   //! typed mode. This allows for having results larger than the   //! available memory, and returning some more info about the result. - //! Returns @expr{0@} if the query didn't return any result (e.g. - //! INSERT or similar). +    //!   //! @note   //! Neither streaming operation nor typed results are supported   //! by all sql databases. If not supported, this function will   //! fall back to calling @[big_typed_query()].   //!   //! @seealso   //! @[streaming_query], @[big_typed_query] - variant int|.Result streaming_typed_query(object|string q, + variant .Result streaming_typed_query(object|string q,    string|multiset|int|float|object extraarg,    string|multiset|int|float|object ... extraargs)   {    return streaming_typed_query(@handle_extraargs(q, ({ extraarg }) + extraargs));   }      //! Create a new database.   //!   //! @param db   //! Name of database to create.
pike.git/lib/modules/__builtin.pmod/Sql.pmod/Connection.pike:1224:    return res;   }      //! Sends a typed query to the database asynchronously.   //!   //! @returns   //! An @[Sql.Promise] object which can be used to obtain   //! an @[Sql.FutureResult] object to evaluate the query.   //!   //! @seealso - //! @[big_typed_query()], @[Sql.Promise], @[Sql.FutureResult] + //! @[streaming_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.   //!