|xid - a unique id number|
|xtype - the string require or function|
|xname - if xtype = require, then xname is a package name, like Text::Soundex. if xtype = function, xname is a function name. A function name may be qualified with a package.|
|args - if xtype = require, an (optional) blank-separated list of functions to import to the default Genezzo namespace. if xtype = function, supply an actual function body in curly braces.|
|owner - owner of the package or function|
|creationdate - date row was created|
|argstyle - if set to HASH, pass a hash of the dictionary, the dbh, and the array ref function_args, else the function is just passed an array of the function arguments.|
|sqlname - currently UNUSED. Will be used to distinguish the perl function name from the SQL function name|
|typecheck - currently UNUSED. Will be used to distinguish a supplied type-checking function from a purely SQL execution function.|
insert into user_functions values (1, require, Genezzo::Havok::Examples, isRedGreen, SYSTEM, 2004-09-21T12:12);
The row causes UserFunctions to require Genezzo::Havok::Examples, and it imports isRedGreen into the default Genezzo namespace* (actually, it creates a stub function that calls Genezzo::Havok::Examples::isRedGreen").
An easier method is to use add_user_function, which is defined in Genezzo::Havok::Utils. The equivalent command to load the isRedGreen function is:
select add_user_function( module=Genezzo::Havok::Examples, function=isRedGreen) from dual;
use sqlname and typecheck attributes in user_functions table Need to fix import mechanism so can load specific functions into Genezzo::GenDBI namespace, versus creating stub functions. Use import and export_to_level. Could just load Acme::Everything and wed be done... Need function type information so can validate argument lists, determine return type of function. If pass named args, have TypeCheck and Execute modes for sql_function. Or have typecheck function pass back name/ref to execute function, since it may change depending on argument types.
Jeffrey I. Cohen, email@example.com
Copyright (c) 2004, 2005, 2006 Jeffrey I Cohen. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Address bug reports and comments to: firstname.lastname@example.org
|perl v5.20.3||GENEZZO::HAVOK::USERFUNCTIONS (3)||2006-12-03|