NAME
Handel::DBI - Base DBI class used by cart/order objects
SYNOPSIS
use Handel::DBI;
my $newid = Handel::DBI::uuid;
my $newid = Handel::DBI->uuid;
my $newid = Handel::Cart->uuid;
my $newid = Handel::Cart::Item->uuid;
..etc...
VERSION
$Id: DBI.pm 274 2005-03-02 02:22:05Z claco $
DESCRIPTION
This is the main base class for Handel objects that access the database. There shouldn't be and reason to use this module directly for now.
FUNCTIONS
uuid
Returns a guid/uuid using the first available uuid generation module. The support modules are UUID, Data::UUID, Win32::Guidgen, and Win32API::GUID.
use Handel::DBI;
my $newid = Handel::DBI::uuid;
Since Handel::Cart
and Handel::Cart::Item
are subclasses of Handel::DBI
, uuid
is available within those modules as a method/function as well
use Handel::Cart;
my $newid = Handel::Cart->uuid;
has_wildcard
Inspects the supplied search filter to determine whether it contains wildcard searching. Returns 1 if the filter contains SQL wildcards, other it returns undef
.
has_wildcard({sku => '1234'}); # 1
has_wildcard((sku => '12%')); # undef
This is used by Handel::Cart->items
and Handel::Cart::load
to determine which Class::DBI methods to call (search vs. search_like).
ENVIRONMENT VARIABLES
For now, Handel::DBI
constructs its connection string using the following variables:
db_driver
-
The name of the DBD driver. Defaults to
mysql
. db_host
-
The name of the database server. Defaults to
localhost
. db_port
-
The port of the database server. Defaults to
3306
. db_name
-
The name of the database. Defaults to
commerce
. db_user
-
The user name used to connect to the server. Defaults to
commerce
. db_pass
-
The password used to connect to the server. Defaults to
commerce
.
For now, these can either be set in ENV
, or using PerlSetVar in httpd.conf
.
At some point, this needs to be reworked into a more generic config loader so we can use $ENV, httpd.conf directives, of config files, etc.
SEE ALSO
UUID, Data::UUID, Win32::Guidgen, Win32API::GUID
AUTHOR
Christopher H. Laco
CPAN ID: CLACO
cpan@chrislaco.com
http://today.icantfocus.com/blog/