Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

class::dbi::pg(3pm) [debian man page]

Class::DBI::Pg(3pm)					User Contributed Perl Documentation				       Class::DBI::Pg(3pm)

NAME
Class::DBI::Pg - Class::DBI extension for Postgres SYNOPSIS
use strict; use base qw(Class::DBI::Pg); __PACKAGE__->set_db(Main => 'dbi:Pg:dbname=dbname', 'user', 'password'); __PACKAGE__->set_up_table('film'); DESCRIPTION
Class::DBI::Pg automate the setup of Class::DBI columns and primary key for Postgres. select Postgres system catalog and find out all columns, primary key and SERIAL type column. create table. CREATE TABLE cd ( id SERIAL NOT NULL PRIMARY KEY, title TEXT, artist TEXT, release_date DATE ); setup your class. package CD; use strict; use base qw(Class::DBI::Pg); __PACKAGE__->set_db(Main => 'dbi:Pg:dbname=db', 'user', 'password'); __PACKAGE__->set_up_table('cd'); This is almost the same as the following way. package CD; use strict; use base qw(Class::DBI); __PACKAGE__->set_db(Main => 'dbi:Pg:dbname=db', 'user', 'password'); __PACKAGE__->table('cd'); __PACKAGE__->columns(Primary => 'id'); __PACKAGE__->columns(All => qw(id title artist release_date)); __PACKAGE__->sequence('cd_id_seq'); METHODS
set_up_table TABLENAME HASHREF Declares the Class::DBI class specified by TABLENAME. HASHREF can specify options to when setting up the table. ColumnGroup You can specify the column group that you want your columns to be in. $class->set_up_table($table, { ColumnGroup => 'Essential' }); The default is 'All' Primary Overrides primary key setting. This can be useful when working with views instead of tables. pg_version Returns the postgres version that you are currently using. AUTHOR
Daisuke Maki "dmaki@cpan.org" AUTHOR EMERITUS
Sebastian Riedel, "sri@oook.de" IKEBE Tomohiro, "ikebe@edge.co.jp" LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Class::DBI Class::DBI::mysql DBD::Pg perl v5.10.1 2006-07-09 Class::DBI::Pg(3pm)

Check Out this Related Man Page

Class::DBI::Search::Basic(3pm)				User Contributed Perl Documentation			    Class::DBI::Search::Basic(3pm)

NAME
Class::DBI::Search::Basic - Simple Class::DBI search SYNOPSIS
my $searcher = Class::DBI::Search::Basic->new( $cdbi_class, @search_args ); my @results = $searcher->run_search; # Over in your Class::DBI subclass: __PACKAGE__->add_searcher( search => "Class::DBI::Search::Basic", isearch => "Class::DBI::Search::Plugin::CaseInsensitive", ); DESCRIPTION
This is the start of a pluggable Search infrastructure for Class::DBI. At the minute Class::DBI::Search::Basic doubles up as both the default search within Class::DBI as well as the search base class. We will probably need to tease this apart more later and create an abstract base class for search plugins. METHODS
new my $searcher = Class::DBI::Search::Basic->new( $cdbi_class, @search_args ); A Searcher is created with the class to which the results will belong, and the arguments passed to the search call by the user. opt if (my $order = $self->opt('order_by')) { ... } The arguments passed to search may contain an options hash. This will return the value of a given option. run_search my @results = $searcher->run_search; my $iterator = $searcher->run_search; Actually run the search. SUBCLASSING
sql / bind / fragment The actual mechanics of generating the SQL and executing it split up into a variety of methods for you to override. run_search() is implemented as: return $cdbi->sth_to_objects($self->sql, $self->bind); Where sql() is $cdbi->sql_Retrieve($self->fragment); There are also a variety of private methods underneath this that could be overridden in a pinch, but if you need to do this I'd rather you let me know so that I can make them public, or at least so that I don't remove them from under your feet. perl v5.12.4 2011-08-10 Class::DBI::Search::Basic(3pm)
Man Page