Jeffrey Cohen
and 1 contributors

NAME

Genezzo::Havok - Cry Havok! And Let Slip the Dogs of War!

SYNOPSIS

use Genezzo::Havok; # Wreak Havok

# in sql select HavokUse('Genezzo::Havok') from dual;

create table havok ( hid number, modname char, owner char, creationdate char, flag char, version char, regdate char );

hid - a unique id number
modname - a havok module name
owner - module owner
creationdate - date of module creation
flag - (user-defined)
version - module version information
regdate - registration date (date of row creation)

DESCRIPTION

After database startup, the Havok subsystem runs arbitrary code to modify your Genezzo installation.

WHY?

Havok lets you construct novel, sophisticated extensions to Genezzo as "plug-ins". The basic Genezzo database kernel can remain small, and users can download and install additional packages to extend Genezzo's functionality. This system also gives you a modular upgrade capability.

Examples

See Genezzo::Havok::UserExtend, a module that lets users install custom functions or entire packages. The Havok regression test, t/Havok1.t, loads Text::Soundex and demonstrates a soundex comparison of strings in a table. You can easily add other string or mathematical functions.

ARGUMENTS

FUNCTIONS

HavokInit Calls the HavokInit for every module in the havok table, supplying a hash of the dictionary, the flag, and the module version. The clients should return an array where the first element is a success code (0 or 1) and the second is the updated flag (if necessary).
HavokCleanup
HavokUse, MakeYML

Havok modules which have a .yml metadata document can be loaded using the sql HavokUse function, which (eventually) calls Genezzo::Havok::HavokUse. Modules should create a dependency hash similar to Genezzo::Havok::MAKEDEPS (which is itself similar to the MakeMaker META.yml) and use Genezzo::Havok::MakeYML to create the document. Currently, MakeYML is fake YAML.

EXPORT

LIMITATIONS

Havok is intended for specialized packages which extend the fundamental database mechanisms. If you only want to add new SQL functions, then you should use Genezzo::Havok::UserFunctions.

Havok is actually spelled "havoc", but I am ignorent.

TODO

extension to support CPAN install via HavokUse
use real YAML vs "fake" yaml documents
Create dictionary initialization havok (vs post-startup havok)
Need some type of first-time registration function. For example, if your extension module needs to install new dictionary tables. Probably can add arg to havokinit, and add a flag to havok table to track init status.
Safety/Security: could load modules using Safe package to restrict their access (not a perfect solution). May also want to construct a dictionary wrapper to restrict dictionary capabilities for certain clients, e.g. let a package read, but not update, certain dictionary tables.
Force Init/ReInit when new package is loaded.
update module flags if necessary, handle cleanup
use something like Sub::Install, Sub::Installer, or Hook::WrapSub to redefine the subroutines in SysHook, etc.

AUTHOR

Jeffrey I. Cohen, jcohen@genezzo.com

SEE ALSO

perl(1).

Copyright (c) 2003-2007 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: jcohen@genezzo.com

For more information, please visit the Genezzo homepage at http://www.genezzo.com