NetSDS::DBI - DBI wrapper for NetSDS
use NetSDS::DBI; $dbh = NetSDS::DBI->new( dsn => 'dbi:Pg:dbname=test;host=127.0.0.1;port=5432', login => 'user', passwd => 'topsecret', ); print $db->call("select md5(?)", 'zuka')->fetchrow_hashref->{md5};
NetSDS::DBI module provides wrapper around DBI module.
NetSDS::DBI
$dbh = NetSDS::DBI->new( dsn => 'dbi:Pg:dbname=test;host=127.0.0.1;port=5432', login => 'user', passwd => 'topsecret', );
Method call() implements the following functionality:
call()
* check connection to DBMS and restore it * prepare chached SQL statement * execute statement with bind parameters
Parameters:
* SQL query with placeholders * bind parameters
Return:
* statement handler from DBI
Example:
$sth = $dbh->call("select * from users"); while (my $row = $sth->fetchrow_hashref()) { print $row->{username}; }
$obj->add_sets("set search_path to myscheme"); $obj->add_sets("set client_encoding to 'UTF-8'");
$this->add_attrs(AutoCommit => 1);
Internal method checking connection and implement reconnect
Internal method starting connection to DBMS
samples/testdb.pl
Unknown yet
None
Michael Bochkaryov <misha@rattler.kiev.ua>
To install NetSDS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm NetSDS
CPAN shell
perl -MCPAN -e shell install NetSDS
For more information on module installation, please visit the detailed CPAN module installation guide.