John Williams schrieb:
The proposals so far have dealt mostly with the SQL itself, and
supporting database-neutral layers on top of DBI.

Personally, I don't mind writing the SQL myself, I rarely need to make
a particular statement work on two databases in my work, and I can
optimize a lot better than any SQL generator.

I like DBI shortcuts (selectrow_array, etc), and I would like them
to become even more convenient in DBIv2, so I have been thinking
about ways to streamline the movement of data in and out of DBI.

A lot of these ideas are probably obvious, but I haven't seen them
actually stated anywhere yet.  A lot may be bad or wrong, which is
where you readers come in...


I like the way Juerd Waalboer simplyfied the DBI API (DBIx::Simple):

for my $row ($db->query('SELECT * FROM ...')->arrays) {
  print $row->[0], $row->[1];
}

$db->query('SELECT a, b FROM table WHERE c = ?', $c)->into(my ($a,$b));

($id) = $db->query('SELECT MAX(id) FROM table')->list;

my @all_ids = $db->query('SELECT id FROM table WHERE ...')->flat;

Maybe you can get some inspiration from:

http://search.cpan.org/~juerd/DBIx-Simple-1.25/lib/DBIx/Simple/Examples.pod

--
Raphael

Reply via email to