PET::Util::MySQL |
This package handles MySQL. Needs much work! Method names are currently fucked up.
FIXME, getDBH and SQLConnect should be moved to PET::Util::_ConnectionHandler ! FIXME, we should probably have a PET::Util::_SQL, too... (Note: underscores mean that they are not really Util::* packages...)
| PET:: | This package handles MySQL. |
| Variables | |
| $IFLOG | |
| $CONFIG | |
| Functions | |
| NAME | |
| Variables | |
| $CONNECTMETHOD | |
| $defaulthandler | |
| Functions | |
| init () | |
| getDBH | |
| SQLConnect | |
| prepareSth(%p) | Used by many SQL routines, this prepares a statement handle. |
| fetchSQL(%p) | Issue an SQL query via (stored) SQL prepared statement, returns hashrefs of arrayref. |
| issueQuery | |
| getSqlRow (%p) | Gets a MySQL row. |
| getSqlArray | |
| getRowById ($what, $id, $dbhname, %p) | Get one hashref by a unique key usage: $UTIL->getRowById(‘users.id’ => 15, ‘main’); |
| searchSql | |
| updateRowById | |
| insertRow (%p) | This is going to exchange insertRow later. |
| insertRow ($dbhname, $table, %values) | Inserts a row into a MySQL table. |
| deleteRowById | |
| fetchfromdbh | |
| cleanup () | Clean up resources (only in some cases!) |
| DESTROY () | Clean up resources. |
sub prepareSth
Used by many SQL routines, this prepares a statement handle. Accepts: dbhname, query, prepared (default: 1), bindparams
scalar, arrayref : a query on the default handler + query parameters scalar, scalar, arrayref : a query on the named handler (1st) + query + query params scalar : only one query is passed
sub insertRow
Inserts a row into a MySQL table.
$dbhname : database handler (TODO: this will change, this handling is illogical) $table : SQL table to insert into %values : key - value pairs (if value is a ref, then it is directly inserted, e.g. \”NOW()” will result in “... field=NOW()...” instead of “...field=?... [ “NOW()” ]...”
our $IFLOG
our $CONFIG
sub NAME
our $CONNECTMETHOD
my $defaulthandler
sub init
sub getDBH
sub SQLConnect
Used by many SQL routines, this prepares a statement handle.
sub prepareSth
Issue an SQL query via (stored) SQL prepared statement, returns hashrefs of arrayref.
sub fetchSQL( $% )
sub issueQuery
Gets a MySQL row.
sub getSqlRow
sub getSqlArray
Get one hashref by a unique key usage: $UTIL->getRowById(‘users.id’ => 15, ‘main’);
sub getRowById
sub searchSql
sub updateRowById
This is going to exchange insertRow later.
sub insertRow2
Inserts a row into a MySQL table.
sub insertRow
sub deleteRowById
sub fetchfromdbh
Clean up resources (only in some cases!)
sub cleanup
Clean up resources.
sub DESTROY