pike.git
/
lib
/
modules
/
Sql.pmod
/
mysql.pike
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/mysql.pike:1:
/*
-
* $Id: mysql.pike,v 1.
43
2008
/11/
26
01
:
02
:57
mast
Exp $
+
* $Id: mysql.pike,v 1.
44
2009
/11/
10
12
:
55
:57
grubba
Exp $
* * Glue for the Mysql-module */ //! Implements the glue needed to access the Mysql-module from the generic //! SQL module. #pike __REAL_VERSION__ #if constant(Mysql.mysql)
pike.git/lib/modules/Sql.pmod/mysql.pike:704:
//! Primarily useful with @[charset] set to @expr{"latin1"@} if //! unicode encode mode (see @[set_unicode_encode_mode]) is enabled //! (the default) and you have some large queries (typically blob //! inserts) where you want to avoid the query parsing overhead. //! //! @returns //! A @[Mysql.mysql_result] object is returned if the query is of a //! kind that returns a result. Zero is returned otherwise. //! //! @seealso
-
//! @[Sql.big_query]
+
//! @[Sql.big_query
()
]
, @[big_typed_query()], @[streaming_query()]
{ QUERY_BODY (big_query); } Mysql.mysql_result streaming_query (string query, mapping(string|int:mixed)|void bindings, void|string charset) //! Makes a streaming SQL query. //! //! This function sends the SQL query @[query] to the Mysql-server. //! The result of the query is streamed through the returned //! @[Mysql.mysql_result] object. Note that the involved database //! tables are locked until all the results has been read. //! //! In all other respects, it behaves like @[big_query].
-
+
//!
+
//! @seealso
+
//! @[big_query()], @[streaming_typed_query()]
{ QUERY_BODY (streaming_query); }
-
+
Mysql.mysql_result big_typed_query (string query,
+
mapping(string|int:mixed)|void bindings,
+
void|string charset)
+
//! Makes a typed SQL query.
+
//!
+
//! This function sends the SQL query @[query] to the Mysql-server.
+
//!
+
//! The types of the result fields depend on the corresponding SQL types.
+
//! They are mapped as follows:
+
//! @mixed
+
//! @type zero
+
//! The @tt{NULL@} value is returned as @[UNDEFINED].
+
//! @type int
+
//! Integer values are returned as @tt{int@} values.
+
//! @type float
+
//! Floating point values are returned as @tt{float@} values.
+
//! @type string
+
//! All other SQL field types are returned as @tt{string@} values.
+
//! @endmixed
+
//!
+
//! In all other respects, it behaves like @[big_query].
+
//!
+
//! @seealso
+
//! @[big_query()], @[streaming_typed_query()]
+
{
+
QUERY_BODY (big_typed_query);
+
}
+
+
Mysql.mysql_result streaming_typed_query (string query,
+
mapping(string|int:mixed)|void bindings,
+
void|string charset)
+
//! Makes a streaming typed SQL query.
+
//!
+
//! This function acts as the combination of @[streaming_query()]
+
//! and @[big_typed_query()].
+
//!
+
//! @seealso
+
//! @[big_typed_query()], @[streaming_typed_query()]
+
{
+
QUERY_BODY (streaming_typed_query);
+
}
+
int(0..1) is_keyword( string name ) //! Return 1 if the argument @[name] is a mysql keyword that needs to //! be quoted in a query. The list is currently up-to-date with MySQL //! 5.1. { return ([ "accessible": 1, "add": 1, "all": 1, "alter": 1, "analyze": 1, "and": 1, "as": 1, "asc": 1, "asensitive": 1, "before": 1, "between": 1, "bigint": 1, "binary": 1, "blob": 1, "both": 1, "by": 1, "call": 1, "cascade": 1, "case": 1, "change": 1, "char": 1, "character": 1, "check": 1, "collate": 1,
pike.git/lib/modules/Sql.pmod/mysql.pike:842:
#endif } else { ::create(host||"", database||"", user||"", password||""); update_unicode_encode_mode_from_charset ("latin1"); } } #else
+
final constant dont_dump_module=1;
constant this_program_does_not_exist=1; #endif /* constant(Mysql.mysql) */