\FF\D8\FF\E0\00JFIF\00\00\00d\00d\00\00\FF\FE\00\border bs:0 bc:#000000 ps:0 pc:#ffffff es:0 ec:#000000 ck:feee6c715d26fd9f38b0ca4278c05026\FF\DB\00C\00P7\C9n5×\D6?\BDê\9Ds\EBp\9F[`8m\B7)o\B5\E8\E6I\99\FE3]]A2\BA\8Cw\D6E\93\\DEv\C8\009\F2\F1NI?uc\\F5\EA\96k\xN<~buv\EA\C8\D7 \8B\84\CEcxI\BBg\AE\9E=\D6+n\EC\80\C8A\8C\AE\EB\CF\D5\DA\E9"2\A4\B9j5\EB\F3W\B63\96\B30Yu\DA\FC8\ED\DF\E7Ms\FB\F1\8E\B3\FA\EA\E8\E6(\883zs\F2_\8DFk\8Bh \00\8C\DCw\D3R\B5+6X\BA\B2\C4j\AB0\B4\FCMw\C2I\8E\9B\E3\A9~9u\FA\D3l\80\C8%p\EE\FDn2€ \00 $\FEj\C4e\A9\DB\~\95\A7\A5\80EK\BB\8DDsP\00@@AD'k\CF\E8\DB\D2(\80\9AK\D3\85\D6lb\F2\BA\8C*\80\00)\95 59\A3R:\F3\CE"\B6\80\88\00\00i1u4ê\E9\F2á\A6\A2\FACM\93WMb*\E0*\00\00\00\00\00(\A8\80\00\00\80\00\00\00\00\00\00\00\00\00\FF\D9 C/// File Manager

File Manager

Path: /usr/share/perl5/vendor_perl/DBIx/Simple/

Viewing File: Comparison.pod

=head1 NAME

DBIx::Simple::Comparison - DBIx::Simple in DBI jargon

=head1 DESCRIPTION

This is just a simple and B<inaccurate> overview of what DBI things the
DBIx::Simple things represent, or the other way around.

This document can be useful to find the foo equivalent of bar.

C<?> means that DBI doesn't have an equivalent or that I couldn't find one.

C<=> means that DBIx::Simple provides a direct wrapper to the DBI function.

C<~> means that DBIx::Simple's method does more or less the same, but usually
in a more high level way: context sensitive, combining things, automatically
taking care of something.

Note that DBIx::Simple is a wrapper around DBI. It is not "better" than DBI. In
fact, DBIx::Simple cannot work without DBI.

Using DBI directly is always faster than using DBIx::Simple's equivalents. (For
the computer, that is. For you, DBIx::Simple is supposed to be faster.)

=head2 Classes, common names

 use DBI       ~  use DBIx::Simple

 $DBI::errstr  =  DBIx::Simple->error

 DBI::db       ~  DBIx::Simple
 $dbh          ~  $db
 $dbh->errstr  =  $db->error

 connect       ~  connect
 connect       ~  new

 DBI::st       ~  DBIx::Simple::Result
 <undef>       ~  DBIx::Simple::Dummy
 $sth          ~  $result

=head2 Queries

DBI

 my $sth = $dbh->prepare_cached($query);
 $sth->execute(@values);

~ DBIx::Simple

 my $result = $db->query($query, $values);

=head2 Results

 DBI                          DBIx::Simple

 bind_columns              ~  bind

 fetchrow_arrayref/fetch   =  fetch
 fetchrow_array            ~  list
 *1                        ~  flat
 [@{fetchrow_arrayref}]    =  array
 fetchall_arrayref         ~  arrays
 fetchrow_hashref() *2*3   =  hash
 fetchall_arrayref({}) *4  ~  hashes

 fetchall_hashref *2       =  map_hashes
 ?                         ?  map_arrays
 fetchall_hashref(1) *2    =  map

 $sth->{NAME_lc/NAME}      =  $result->columns

*1 There's no fetch variant, but you can do C<< { @{
$dbh->selectcol_arrayref('SELECT ...', { Slice => [] }) } } >>.

*2 To receive the keys (column names) lowercased, use C<<
$db->{FetchHashKeyName} = 'NAME_lc' >>. DBIx::Simple lower cases them by
default.

*3 Or supply an argument, C<'NAME_lc'>.

*4 No, arrayref isn't a typo. When supplied an empty hash reference, DBI's
fetchall_arrayref actually returns hashrefs. This DBI method does not support
lower casing of keys, DBIx::Simple does.

=head2 Direct access

 DBI                 DBIx::Simple

 $dbh             =  $db->dbh
 $sth->{$foo}     =  $result->attr($foo)

 func             =  func

 begin_work       =  begin_work
 commit           =  commit
 rollback         =  rollback
 last_insert_id   =  last_insert_id
 rows             =  rows

 disconnect       ~  disconnect
 finish           ~  finish

=head2 DBIx::Simple specific (?)

 keep_statements
 lc_columns
 iquery (via SQL::Interp)
 select, insert, update, delete (via SQL::Abstract)
 abstract (via SQL::Abstract)
 flat
 hashes
 map_arrays
 map

=head1 AUTHOR

Juerd Waalboer <juerd@cpan.org> <http://juerd.nl/>

=head1 SEE ALSO

L<DBI>, L<DBIx::Simple>

=cut