The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Egg::Plugin::DBI::Accessors - Convenient accessor to dbh.

SYNOPSIS

  use MYPROJECT;
  use strict;
  use Egg qw/DBI::Accessors/;

Example of code.

  my $scalar= $e->dbh_scalarref(q{ SELECT foo FROM hoge WHERE id = ? }, '123')
    || Egg::Error->error 'Data is not found.';
  
  my $hash= $e->dbh_hashref('foo', q{ SELECT * FROM hoge WHERE id = ? }, '123')
    || Egg::Error->error 'Data is not found.';
  
  my $array= $e->dbh_arrayref(q{ SELECT * FROM hoge WHERE type = ? }, 'udon')
    || Egg::Error->error 'Data is not found.';
  
  $e->dbh_any(
    q{ INSERT INTO hoge (id, type, name) VALUES (?, ?, ?) },
    '124', 'udon', 'banban',
    );

DESCRIPTION

When the data base handler is treated, it is ..some procedure.. omissible.

It is effective because Egg::Plugin::DBI::CommitOK has been succeeded to even if it doesn't describe it in the controller. However, committing is not done in the automatic operation.

METHODS

$e->dbh_hashref([KEY], [SQL], [ARGS], ...);

The execution result is returned by the HASH reference.

Please specify the field name of the content's being sure being sure to exist for [KEY].

$e->dbh_arrayref([SQL], [ARGS], ...);

The execution result is returned by the ARRAY reference.

$e->dbh_scalarref([SQL], [ARGS], ...);

The execution result is returned by the SCALAR reference.

$e->dbh_any([SQL], [ARGS], ...);

When it doesn't generate the return value.

SEE ALSO

Egg::Plugin::DBI::CommitOK Egg::Release,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT

Copyright (C) 2006 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

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.6 or, at your option, any later version of Perl 5 you may have available.