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:
parent
0cbc86a243
commit
2e455b0861
1 changed files with 7 additions and 0 deletions
|
@ -1927,6 +1927,13 @@ After this, it could be used from SQL as:
|
||||||
|
|
||||||
INSERT INTO mytable ( now() );
|
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
|
=head3 REGEXP function
|
||||||
|
|
||||||
SQLite includes syntactic support for an infix operator 'REGEXP', but
|
SQLite includes syntactic support for an infix operator 'REGEXP', but
|
||||||
|
|
Loading…
Add table
Reference in a new issue