Class::DBI::Pg::More - Enhances Class::DBI::Pg with more goodies.
package MyClass; use base 'Class::DBI::Pg::More'; __PACKAGE__->set_up_table("my_table"); # a_date is a date column in my_table. # Class::DBI::Plugin::DateFormat::Pg->has_date has been # called for a_date implicitly. my $a_date_info = __PACKAGE__->pg_column_info('a_date') print $a_date_info->{type}; # prints "date" # an_important is an important column in my_table set to not null print $a_date_info->{is_nullable} ? "TRUE" : "FALSE"; # prints FALSE
This class overrides Class::DBI::Pg set_up_table method to setup more things from the database.
set_up_table
It recognizes date, timestamp etc. columns and calls Class::DBI::Plugin::DateTime::Pg has_* methods on them.
Class::DBI::Plugin::DateTime::Pg
It also fetches some constraint information (currently not null).
not null
This is main entry point to the module. Please see Class::DBI::Pg documentation for its description.
Class::DBI::Pg
This class automagically uses Class::DBI::Plugin::DateTime::Pg for date/time fields, so you should use DateTime values with them.
Wraps Ima::DBI set_sql methods to create exec_$name function which basically calls execute on sql_$name handle.
Ima::DBI
set_sql
exec_$name
execute
sql_$name
@arg_map provides mapping of the arguments to the exec function. It can be used to call instance methods to get execution parameters.
@arg_map
For example given "update __TABLE__ set col = ? where id = ?" statement argument map (undef, "id") tells to substitute last parameter by results of the $self->id function.
Wraps Ima::DBI set_sql methods to create fetch_$name function which basically calls execute and fetchall_arrayref on sql_$name handle.
fetch_$name
fetchall_arrayref
For description of $slice parameter see DBI fetchall_arrayref function.
$slice
@arg_map is described above.
Returns column information as HASHREF. Currently supported flags are:
$column
Boris Sukholitko CPAN ID: BOSU boriss@gmail.com
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
Class::DBI::Pg, Class::DBI::Plugin::DateTime::Pg.
To install Class::DBI::Pg::More, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::DBI::Pg::More
CPAN shell
perl -MCPAN -e shell install Class::DBI::Pg::More
For more information on module installation, please visit the detailed CPAN module installation guide.