jabowery has asked for the wisdom of the Perl Monks concerning the following question:
?$db=DDSMySQL->connect(...); $object=$db->{table_foo}->{id}=$bar; $object->{some_other_key}=$blah; $baz=$object->{baz}; $qux=$object->{qux}; ...etc...
It's OK (by me) if it generates accessors instead (or in addition to) hash keys from its interrogation of MySQL for the db's schema:
$object=$db->table_foo->id($bar); $object->some_other_key($blah); $baz=$object->baz; $qux=$object->qux; ...etc...
PS: It might be entertaining to quibble over whether, in the tradition of Perl's tendency to default to allocate stuff it needs on demand, it should create a row with 'id' equal to $bar and 'some_other_key' equal to $blah if it doesn't find that composite key already in the database. But I digress...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Drop dead simple MySQL interface?
by jeffa (Bishop) on Apr 04, 2012 at 23:57 UTC | |
|
Re: Drop dead simple MySQL interface?
by NetWallah (Canon) on Apr 05, 2012 at 02:59 UTC | |
by jabowery (Beadle) on Apr 05, 2012 at 14:23 UTC | |
by NetWallah (Canon) on Apr 05, 2012 at 15:29 UTC |