in reply to Re: Drop dead simple MySQL interface?
in thread Drop dead simple MySQL interface?
An extreme simplification of the Tied interface would make the first level of hash specify the database server type (ie: server=>'dbi:mysql'), the second level hash specify the credentials (ie: {user=>..., password=>...}), a third level specifying the database name (ie: {$database_name=>{...}}) and then the rest of the hashes behave as previously described for tables and fields.
Also, if something is underspecified, it might return an array; but if it worked that way, the row and field hash interfaces would have to always go through an array ref, ie:
Blech... But I suppose the schema could restrict that mess to when that level of indirection was required.$baz=$object->[0]->{baz}->[0]; $qux=$object->[0]->{qux}->[0];
Finally, I suppose insertion of a row could also take the form of a 'new' method on the table:
$table->new({baz=>$baz,$qux=>$qux,...});And if there is an autoincrement key (like 'id'), leaving it out would imply its value to be the next incremented value of that field for that table.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Drop dead simple MySQL interface?
by NetWallah (Canon) on Apr 05, 2012 at 15:29 UTC |