pike.git
/
lib
/
modules
/
Sql.pmod
/
pgsql.pike
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/pgsql.pike:177:
//! you can use @ref{template1@}. //! //! @param options //! Currently supports at least the following: //! @mapping //! @member int "reconnect" //! Set it to zero to disable automatic reconnects upon losing //! the connection to the database. Not setting it, or setting //! it to one, will cause one timed reconnect to take place. //! Setting it to -1 will cause the system to try and reconnect
-
//! indefinitely
+
//! indefinitely
.
//! @member int "use_ssl" //! If the database supports and allows SSL connections, the session //! will be SSL encrypted, if not, the connection will fallback
-
//! to plain unencrypted
+
//! to plain unencrypted
.
//! @member int "force_ssl" //! If the database supports and allows SSL connections, the session
-
//! will be SSL encrypted, if not, the connection will abort
+
//! will be SSL encrypted, if not, the connection will abort
.
//! @member int "text_query" //! Send queries to and retrieve results from the database using text //! instead of the, generally more efficient, default native binary method. //! Turning this on will allow multiple statements per query separated
-
//! by semicolons
+
//! by semicolons
.
//! @member int "cache_autoprepared_statements" //! If set to zero, it disables the automatic statement prepare and //! cache logic; caching prepared statements can be problematic //! when stored procedures and tables are redefined which leave stale
-
//! references in the already cached prepared statements
+
//! references in the already cached prepared statements
.
//! @member string "client_encoding" //! Character encoding for the client side, it defaults to using //! the default encoding specified by the database, e.g. //! @ref{UTF8@} or @ref{SQL_ASCII@}. //! @member string "standard_conforming_strings" //! When on, backslashes in strings must not be escaped any longer,
-
//! @[quote()] automatically adjusts quoting strategy accordingly
+
//! @[quote()] automatically adjusts quoting strategy accordingly
.
//! @member string "escape_string_warning" //! When on, a warning is issued if a backslash (\) appears in an //! ordinary string literal and @[standard_conforming_strings] is off, //! defaults to on //! @endmapping //! For the numerous other options please check the PostgreSQL manual. //! //! @note //! You need to have a database selected before using the sql-object, //! otherwise you'll get exceptions when you try to query it. Also //! notice that this function @b{can@} raise exceptions if the db //! server doesn't respond, if the database doesn't exist or is not //! accessible by you. //! //! @seealso //! @[Postgres.postgres], @[Sql.Sql], @[select_db()],
-
//! @url{http://
search
.postgresql.org/search?u=%2Fdocs%2F&q=client+connection+defaults@}
+
//! @url{http://
www
.postgresql.org/search
/
?u=%2Fdocs%
2Fcurrent%
2F&q=client+connection+defaults@}
protected void create(void|string _host, void|string _database, void|string _user, void|string _pass, void|mapping(string:mixed) _options) { pass = _pass; _pass = "CENSORED"; if(pass) String.secure(pass); user = _user; database = _database; host = _host || PGSQL_DEFAULT_HOST; options = _options || ([]); if(has_value(host,":") && sscanf(_host,"%s:%d",host,port)!=2) ERROR("Error in parsing the hostname argument\n"); if(!port)
pike.git/lib/modules/Sql.pmod/pgsql.pike:386:
} //! Changes the connection charset. When set to @ref{UTF8@}, the query, //! parameters and results can be Pike-native wide strings. //! //! @param charset //! A PostgreSQL charset name. //! //! @seealso //! @[get_charset()], @[create()],
-
//! @url{http://
search
.postgresql.org/search?u=%2Fdocs%2F&q=character+sets@}
+
//! @url{http://
www
.postgresql.org/search
/
?u=%2Fdocs%
2Fcurrent%
2F&q=character+sets@}
void set_charset(string charset) { big_query(sprintf("SET CLIENT_ENCODING TO '%s'",quote(charset))); } //! @returns //! The PostgreSQL name for the current connection charset. //! //! @seealso //! @[set_charset()], @[getruntimeparameters()],
-
//! @url{http://
search
.postgresql.org/search?u=%2Fdocs%2F&q=character+sets@}
+
//! @url{http://
www
.postgresql.org/search
/
?u=%2Fdocs%
2Fcurrent%
2F&q=character+sets@}
string get_charset() { return _runtimeparameter[CLIENT_ENCODING]; } //! @returns //! Currently active runtimeparameters for //! the open session; these are initialised by the @ref{options@} parameter //! during session creation, and then processed and returned by the server. //! Common values are: //! @mapping //! @member string "client_encoding" //! Character encoding for the client side, e.g. //! @ref{UTF8@} or @ref{SQL_ASCII@}. //! @member string "server_encoding" //! Character encoding for the server side as determined when the
-
//! database was created, e.g.
@ref{UTF8@}
or
@ref{SQL
_
ASCII@}
+
//! database was created, e.g.
@expr{"UTF8"@}
or
@expr{"SQL
_
ASCII"@}.
//! @member string "DateStyle"
-
//! Date parsing/display, e.g.
@ref{ISO
,
DMY@}
+
//! Date parsing/display, e.g.
@expr{"ISO
,
DMY"@}.
//! @member string "TimeZone"
-
//! Default timezone used by the database, e.g.
@ref{localtime@}
+
//! Default timezone used by the database, e.g.
@expr{"localtime"@}.
//! @member string "standard_conforming_strings"
-
//! When on, backslashes in strings must not be escaped any longer
+
//! When on, backslashes in strings must not be escaped any longer
.
//! @member string "session_authorization"
-
//! Displays the authorisationrole which the current session runs under
+
//! Displays the authorisationrole which the current session runs under
.
//! @member string "is_superuser" //! Indicates if the current authorisationrole has database-superuser
-
//! privileges
+
//! privileges
.
//! @member string "integer_datetimes"
-
//! Reports wether the database supports 64-bit-integer dates and times
+
//! Reports wether the database supports 64-bit-integer dates and times
.
//! @member string "server_version"
-
//! Shows the server version, e.g.
@ref{8
.3.
3@}
+
//! Shows the server version, e.g.
@expr{"8
.3.
3"@}.
//! @endmapping //! //! The values can be changed during a session using SET commands to the //! database. //! For other runtimeparameters check the PostgreSQL documentation. //! //! @seealso
-
//! @url{http://
search
.postgresql.org/search?u=%2Fdocs%2F&q=client+connection+defaults@}
+
//! @url{http://
www
.postgresql.org/search
/
?u=%2Fdocs%
2Fcurrent%
2F&q=client+connection+defaults@}
//! //! @note //! This function is PostgreSQL-specific, and thus it is not available //! through the generic SQL-interface. mapping(string:string) getruntimeparameters() { return _runtimeparameter+([]); } //! @returns //! A set of statistics for the current session: