in reply to Re: RFC: Simple DBI abstraction
in thread RFC: Simple DBI abstraction

You make a good point here, Juerd. How about i change the do() arguments to this:
$dbh->do(tableName => "table_name", get => {...}, set => {...})

Replies are listed 'Best First'.
Re^3: RFC: Simple DBI abstraction
by Juerd (Abbot) on Sep 09, 2004 at 13:35 UTC

    You make a good point here, Juerd. How about i change the do() arguments to this: $dbh->do(tableName => "table_name", get => {...}, set => {...})

    Better already, but when in real life is it practical to simultaneously set and get? I can't think of any situation.

    Thus abstracting it more, to two methods instead of one, makes sense to me:

    $dbh->get("table_name", {...}); $dbh->set("table_name", {...});
    Which is very close to what DBIx::Simple lets you write if you have SQL::Abstract installed:
    $db->select('table_name', [...]); $db->update('table_name', {...}, ...);

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      when in real life is it practical to simultaneously set and get
      It's not that you want to set and get, it's that you need to specify WHICH ROWS to set the data to. With get.