NAME

DBI::Simple - Perl extension to allow easy DBI access

SYNOPSIS

  use DBI::Simple;
  $dbi = DBI::Simple->connect('mysql:hostname=localhost;database=main', 'user', 'pass');
  $rs = $dbi->query('SELECT * FROM Users');
  while($rs->has_records)
  {
	  print @{$rs->row};
	  $rs->move_next;
  }
  $rs->insert(name => 'jdoe', pass => 'password');
  $rs->commit;

ABSTRACT

DBI::Simple abstracts the internals of the DBI module.  It inherits from DBI, so you retain all the functionality
of the DBI when using DBI::Simple.

DESCRIPTION

DBI::Simple inherits all the methods of DBI. The following functions are new or operate differently than their DBI counterparts.

connect

The connect function takes the same parameters as the corresponding DBI function. However, it is not necessary to specify "dbi:" in the string. That is, the strings "dbi:mysql:...." and "mysql:..." are equivalent.

dbh

The dbh method returns the underlying DBI database handle.

query($statement)

The query function returns the DBI::Simple::Recordset object that results from executing $statement.

DEPENDENCIES

Requires the DBI module and any necessary DBD drivers.

EXPORT

None by default. All functions are object-oriented.

TODO

  • Update database when members of hash are changed

  • Cache prepared statements for better performance

  • Enable transaction-based updating

SEE ALSO

DBI::Simple::Recordset, DBI, DBD::*

AUTHOR

Bill Atkins, <cpanNOSPAM@batkins.com>

COPYRIGHT AND LICENSE

Copyright 2003 by Bill Atkins

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