Extracted from Pike v7.8 release 352 at 2010-07-30.
pike.ida.liu.se
[Top]
Sql
Sql.pgsql

Method Sql.pgsql()->big_query()


Method big_query

Sql.pgsql_util.pgsql_result big_query(string query)
Sql.pgsql_util.pgsql_result big_query(string query, mapping bindings)

Description

This is the only provided interface which allows you to query the database. If you wish to use the simpler Sql.Sql()->query() function, you need to use the Sql.Sql generic SQL-object.

Bindings are supported natively straight across the network. Special bindings supported are:

":_cache" : int

Forces caching on or off for the query at hand.


Returns

A Sql.pgsql_util.pgsql_result object (which conforms to the Sql.sql_result standard interface for accessing data). It is recommended to use Sql.Sql()->query() for simpler queries (because it is easier to handle, but stores all the result in memory), and Sql.Sql()->big_query() for queries you expect to return huge amounts of data (it's harder to handle, but fetches results on demand).

Note

This function can raise exceptions.

Note

This function supports multiple simultaneous queries (portals) on a single database connection. This is a feature not commonly supported by other database backends.

Note

This function does not support multiple queries in one querystring. I.e. it allows for but does not require a trailing semicolon, but it simply ignores any commands after the first unquoted semicolon. This can be viewed as a limited protection against SQL-injection attacks.

See also

big_typed_query() , Sql.Sql , Sql.sql_result , Sql.Sql()->query() , Sql.pgsql_util.pgsql_result