NAME

Maplat::Web::PostgresDB - Web module for accessing PostgreSQL databases

SYNOPSIS

This module is a wrapper around DBI/DBD::Pg.

DESCRIPTION

With this web module, you can easely maintain connections to multiple databases (just declare multiple modules with different modnames).

Configuration

<module>
        <modname>maindb</modname>
        <pm>PostgresDB</pm>
        <options>
                <dburl>dbi:Pg:dbname=Maplat_DB</dburl>
                <dbuser>Maplat_Server</dbuser>
                <dbpassword>SECRET</dbpassword>
        </options>
</module>

As an alternative, the DB connection info can be included from an external file. The file should look like this:

<postgresql>
        <dburl>dbi:Pg:dbname=Maplat_DB</dburl>
        <dbuser>Maplat_Server</dbuser>
        <dbpassword>SECRET</dbpassword>
</postgresql>

with the options section of the module like this:

<options>
        <include>/path/to/configuration.xml</include>
</options>

A combination of these two is possible, the setting from the included file overwriting the directly configured ones.

dburl is the DBI connection string, see DBD::Pg.

AutoCommit

Get/Set the DBD::Pg "AutoCommit" setting

RaiseError

Get/Set the DBD::Pg "RaiseError" setting

errstr

Get the DBI errorstring.

do

Execute a DBI statement with "do"

prepare

Prepare a (non-cached) Statement.

prepare_cached

Prepare a server cached statement (may fall back to non-cached transparently, see DBD::Pg and PostgreSQL documentation for details).

quote

Quote a variable for use in PostgreSQL statements.

commit

Commit transaction.

rollback

Rollback transaction.

checkDBH

Internal function. Checks if the database handle is valid and reconnects if needed.

Dependencies

This module is a basic module which does not depend on other web modules.

SEE ALSO

Maplat::Web DBD::Pg

AUTHOR

Rene Schickbauer, <rene.schickbauer@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2008-2010 by Rene Schickbauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.