1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00

Add a note on the return value of a function for create_function

This commit is contained in:
Kenichi Ishigaki 2020-01-18 10:01:07 +09:00
parent 0cbc86a243
commit 2e455b0861

View file

@ -1927,6 +1927,13 @@ After this, it could be used from SQL as:
INSERT INTO mytable ( now() );
The function should return a scalar value, and the value is treated as a text
(or a number if appropriate) by default. If you do need to specify a type
of the return value (like BLOB), you can return a reference to an array that
contains the value and the type, as of 1.65_01.
$dbh->sqlite_create_function( 'md5', 1, sub { return [md5($_[0]), SQL_BLOB] } );
=head3 REGEXP function
SQLite includes syntactic support for an infix operator 'REGEXP', but