Maplat::Web::PostgresDB - Web module for accessing PostgreSQL databases
This module is a wrapper around DBI/DBD::Pg.
With this web module, you can easely maintain connections to multiple databases (just declare multiple modules with different modnames).
<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.
Get/Set the DBD::Pg "AutoCommit" setting
Get/Set the DBD::Pg "RaiseError" setting
Get the DBI errorstring.
Execute a DBI statement with "do"
Prepare a (non-cached) Statement.
Prepare a server cached statement (may fall back to non-cached transparently, see DBD::Pg and PostgreSQL documentation for details).
Quote a variable for use in PostgreSQL statements.
Commit transaction.
Rollback transaction.
Internal function. Checks if the database handle is valid and reconnects if needed.
Internal callback function, makes sure there are no open transactions after rendering a page.
This module is a basic module which does not depend on other web modules.
Maplat::Web DBD::Pg
Rene Schickbauer, <rene.schickbauer@gmail.com>
Copyright (C) 2008-2011 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.
To install Maplat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Maplat
CPAN shell
perl -MCPAN -e shell install Maplat
For more information on module installation, please visit the detailed CPAN module installation guide.