Class::DBI::Pg man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

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

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.14.1			  2011-07-19		     Class::DBI::Pg(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net