Oryx::DBI::Util::Pg - Oryx DBI utilities for PostgreSQL connections


Oryx documentation Contained in the Oryx distribution.

Index


Code Index:

NAME

Top

Oryx::DBI::Util::Pg - Oryx DBI utilities for PostgreSQL connections

DESCRIPTION

Top

This provides an Oryx DBI utility class for use with DBD::Pg.

SEE ALSO

Top

Oryx::DBI::Util, DBD::Pg

AUTHORS

Top

Richard Hundt <richard NO SPAM AT protea-systems.com>

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

Top


Oryx documentation Contained in the Oryx distribution.

package Oryx::DBI::Util::Pg;

use base qw(Oryx::DBI::Util);

our %SQL_TYPES = (
    'Oid'       => 'serial PRIMARY KEY',
    'Integer'   => 'integer',
    'String'    => 'varchar',
    'Text'      => 'text',
    'Binary'    => 'bytea',
    'Float'     => 'numeric',
    'Boolean'   => 'integer',
    'DateTime'  => 'timestamp',
);

sub lastval {
    my ($self, $dbh, $table) = @_;
    return $dbh->last_insert_id('%', 'public', $table, 'id');
}

1;
__END__