
perfSONAR_PS::DB::SQL::Base - A class that provides data access for SQL databases

This module provides access to the relevant DBI wrapped methods given the relevant contact points for the database. Any service specific SQL DB handler should ingerit from this class.

package perfSONAR_PS::DB::SQL::PingER; # extend from this class use perfSONAR_PS::DB::SQL::Base; use base perfSONAR_PS::DB::SQL::Base; 1;

constructor accepts hashref as parameter
returns object
accepts hashref as single parameter and initializes object
returns
0 = if everything is okay
-1 = somethign went wrong
opens a connection to the database or reuses the cached one
Returns 0 = if everything is okay -1 = somethign went wrong
closes the connection to the database Returns 0 = if everything is okay -1 = somethign went wrong
checks if db handle is alive
Returns
0 = if everything is okay
-1 = somethign went wrong
accepts single hash param with keys:
query => Rose::DB::Object::QueryBuilder type of query,
table => table name
validate => table validation HASHref constant
index => name of the indexing key for result
returns result as hashref keyd by $index
or undef and sets ERRORMSG
accepts singel hashref param with keys:
set => hashref { for example 'ip_name' => $ip_name, 'ip_number' => $ip_number },
table => table_name
where => where clause ( formatted as Rose::DB::Object query )
returns
0 if OK
-1 = somethign went wrong
accepts single hashref with keys:
insert => { 'ip_name' => $ip_name, 'ip_number' => $ip_number },
table => table_name
returns
0 or last inserted id number
-1 = somethign went wrong
create table from template - second parameter is the name of the template table ( must exist )
returns
0 - evrything is OK
-1 - something is wrong
vlaidated supplied query parameters against defined fields for particular table
optional arg $required is a hash of the required table fields
returns
0 = if everything is okay
-1 = somethign went wrong
fix timestamp returns fixed timestamp or undef if its not parseable
converts any boolean arg to 0/1 int
check presence of the table
Returns
0 = no table 1 = table exists