Alexey Sharafutdinov > DBIx-PgLink-0.01 > DBIx::PgLink

Download:
DBIx-PgLink-0.01.tar.gz

Dependencies

Annotate this POD

Related Modules

WWW::Mechanize
Excel::Template
more...
By perlmonks.org

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.01   Source  

NAME ^

DBIx::PgLink - external database access from PostgreSQL backend using Perl DBI

SYNOPSIS ^

For SQL script examples see DBIx::PgLink::Manual::Usage.

In PL/PerlU function

    use DBIx::PgLink;

    $conn = DBIx::PgLink->connect('NORTHWIND');

    $db = $conn->adapter;
    $db->begin_work;
    $st = $db->prepare('SELECT * FROM Orders WHERE OrderID=?');
    $st->execute(42);
    while (@row = $st->fetchrow_array) {
      ...
    }
    $db->commit;

    $conn->builder->build_accessors(
      local_schema  => 'northwind',
      remote_schema => 'dbo',
      remote_object => 'Order%',
    );

    DBIx::PgLink->disconnect('NORTHWIND');

DESCRIPTION ^

PgLink is based on DBI-Link project for accessing external data sources from PostgreSQL backend.

This module can be used only in untrusted PL/Perl function.

Differences from DBI-Link

SUBROUTINES ^

connect
    $adapter = connect($conn_name);

Load connection metadata from PostgreSQL and connect to remote datasource.

Returns instance of DBIx::PgLink::Connector object.

Subsequent calls return the same cached object. Single connection persists while PostgreSQL session live or until explicit disconnect.

disconnect
    disconnect($conn_name);

Close connection to remote database and delete entry from cache.

named_params
    my $hashref = named_params(\@_, qw/foo bar/); # { foo=>$_[0], bar=>$_[1] }

Utility subroutine. Converts positional arguments of PL/Perl function (passed in @_) to named parameters. NULL arguments are ignored.

Exported by default.

SEE ALSO ^

DBIx::PgLink::Manual::Install, DBIx::PgLink::Manual::Usage, DBI, DBIx::PgLink::Connector, DBIx::PgLink::Adapter, DBIx::PgLink::Accessor::Table, DBIx::PgLink::Local, http://pgfoundry.org/projects/dbi-link/

AUTHOR ^

Alexey Sharafutdinov <alexey.s.v.br@gmail.com>

COPYRIGHT AND LICENSE ^

Copyright (C) 2007 by Alexey Sharafutdinov

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

DBI-Link project by David Fetter under BSD License.

syntax highlighting: