From 271886156b6e9097af8a3f644529a0bcda8676a3 Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Thu, 16 Apr 2015 22:09:48 +0900 Subject: [PATCH] documented optional flags for create_function/aggregate --- lib/DBD/SQLite.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/DBD/SQLite.pm b/lib/DBD/SQLite.pm index 2fe6b72..fc80a77 100644 --- a/lib/DBD/SQLite.pm +++ b/lib/DBD/SQLite.pm @@ -1738,7 +1738,7 @@ Retrieve the current busy timeout. Set the current busy timeout. The timeout is in milliseconds. -=head2 $dbh->sqlite_create_function( $name, $argc, $code_ref ) +=head2 $dbh->sqlite_create_function( $name, $argc, $code_ref, $flags ) This method will register a new function which will be usable in an SQL query. The method's parameters are: @@ -1759,6 +1759,10 @@ the function can take any number of arguments. This should be a reference to the function's implementation. +=item $flags + +You can optionally pass an extra flag bit to create_function, which then would be ORed with SQLITE_UTF8 (default). As of 1.47_02 (SQLite 3.8.9), only meaning bit is SQLITE_DETERMINISTIC (introduced at SQLite 3.8.3), which can make the function perform better. See C API documentation at L for details. + =back For example, here is how to define a now() function which returns the @@ -1827,7 +1831,7 @@ so for most common cases it will be simpler to just add your collation sequences in the C<%DBD::SQLite::COLLATION> hash (see section L below). -=head2 $dbh->sqlite_create_aggregate( $name, $argc, $pkg ) +=head2 $dbh->sqlite_create_aggregate( $name, $argc, $pkg, $flags ) This method will register a new aggregate function which can then be used from SQL. The method's parameters are: @@ -1849,6 +1853,10 @@ of arguments. This is the package which implements the aggregator interface. +=item $flags + +You can optionally pass an extra flag bit to create_aggregate, which then would be ORed with SQLITE_UTF8 (default). As of 1.47_02 (SQLite 3.8.9), only meaning bit is SQLITE_DETERMINISTIC (introduced at SQLite 3.8.3), which can make the function perform better. See C API documentation at L for details. + =back The aggregator interface consists of defining three methods: