ZConf::DBI::utils - Assorted utilities for ZConf::DBI.
Version 0.0.0
This is primarily meant for quick small things. If you are going to calling a lot of stuff here repeatively/heavily, you are probally going to be better off making use of what ever is being called by the function directly.
This initiates the object.
One arguement is required and it is the 'ZConf::DBI' object.
my $foo=ZConf::DBI::util->new($zcdbi); if($foo->error){ warn('error code:'.$foo->error.': '.$foo->errorString); }
This creates a new table using DBIx::Admin::CreateTable->create_table.
Three arguements are required. The first is the data source name. The second is the table name. The third is a SQL string describing the columns.
$foo->create_table('whatever', 'sometable', 'id char(32) primary key, data varchar(255) not null'); if($foo->error){ warn('error code:'.$error.': '.$foo->errorString); }
This executes the do statement on a DBH created from the data source.
Two arguements are required. The first is the data source. The second is the SQL.
$foo->create_table('whatever', 'drop sequence fubar;'); if($foo->error){ warn('error code:'.$error.': '.$foo->errorString); }
This drops a table using DBIx::Admin::CreateTable->drop_table.
Two arguements are required. The first is the data source name. The second is the table name.
$foo->create_table('whatever', 'sometable'); if($foo->error){ warn('error code:'.$error.': '.$foo->errorString); }
Returns the current error code and true if there is an error.
If there is no error, undef is returned.
my $error=$foo->error; if($error){ warn('error code:'.$error.': '.$foo->errorString); }
Returns the error string if there is one. If there is not, it will return undef.
This returns a array reference of table column names found by DBIx::Admin::TableInfo->columns.
There are three arguements taken. The first, and required, is the data source name. The second, and optional, is the schema name. The third, and optional, is the schema.
my $tables=$foo->table_columns('tigerline', 'geometry_columns'); if($foo->error){ warn('error code:'.$foo->error.': '.$foo->errorString); }
This returns a hash reference of table column names found by DBIx::Admin::TableInfo->info.
There are two arguements taken. The first, and required, is the data source name. The second, and optional, is the schema name.
my $tables=$foo->table_info('tigerline', 'geometry_columns'); if($foo->error){ warn('error "'.$foo->error.'"'); }
This returns a array refernce of table names found by DBIx::Admin::TableInfo->tables.
my $tables=$foo->tables('tigerline'); if($foo->error){ warn('error "'.$foo->error.'"'); }
This blanks the error storage and is only meant for internal usage.
It does the following.
$self->{error}=undef; $self->{errorString}=undef;
No ZConf::DBI object passed.
The passed object is not a ZConf::DBI object.
No data source name specified.
DBIx::Admin::TableInfo->new returned undef.
No table specified.
Connect errored.
No SQL defined.
Creating the table frailed.
Dropping the table failed.
Zane C. Bowers, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-zconf-dbi-utils at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ZConf-DBI-utils. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-zconf-dbi-utils at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc ZConf::DBI::utils
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=ZConf-DBI-utils
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/ZConf-DBI-utils
CPAN Ratings
http://cpanratings.perl.org/d/ZConf-DBI-utils
Search CPAN
http://search.cpan.org/dist/ZConf-DBI-utils/
Copyright 2010 Zane C. Bowers, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install ZConf::DBI::utils, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ZConf::DBI::utils
CPAN shell
perl -MCPAN -e shell install ZConf::DBI::utils
For more information on module installation, please visit the detailed CPAN module installation guide.