Adriano Ferreira

NAME

Tao::DBI::db - DBI connection with portable support for named placeholders in statements

SYNOPSIS

  use Tao::DBI qw(dbi_connect dbi_prepare);
  
  $dbh = dbi_connect($args);
  $sql = q{UPDATE T set a = :a, b = :b where k = :k};
  $stmt = $dbh->prepare($sql);
  $rc = $stmt->execute({ k => $k, a => $a, b => $b });
  
  # dbi_prepare() can also be used to create Tao::DBI::st
  $stmt = dbi_prepare($sql, { dbh => $dbh });
  

DESCRIPTION

new
  $dbh = DBI::db::new($args)

Note. Unless $args has an explicit pair at key "FetchHashKeyName", the connection uses "FetchHashKeyName" = 'NAME_lc'> which forces the keys in fetchrow_arrayref to come in lower case.

Note. Unless $args has an explicit pair at key "AutoCommit", the connection uses "AutoCommit" = 0> which means you have to commit or rollback explicitly.

execute
  $sth->execute($hash);
  $sth->execute($param);
  $sth->execute;

Returns

EXPORT

Nothing to be exported. Every method is available as a method.

BUGS

Please report bugs via CPAN RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Tao-DBI.

AUTHOR

Adriano R. Ferreira, <ferreira@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2005-2007 by Adriano R. Ferreira

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.