in reply to RFC : Class::DBI::Loader::AnyDBD

Why not at least try to use the DBI introspection APIs to get column information? Failing that, are you sure that a "SELECT *" will always give you something meaningful in $sth->{NAME} if there are no rows in the table?

Also, I'm not sure defaulting to using the first column as the primary key is a great idea. If you're going to ask that the primary key be set up manually, then don't try to guess. There's no reasonable default, IMO.

The name seems okay to me, though :)

Replies are listed 'Best First'.
Re^2: RFC : Class::DBI::Loader::AnyDBD
by jZed (Prior) on Aug 30, 2005 at 02:50 UTC
    Thanks for your comments.
    > Why not at least try to use the DBI introspection APIs to get column information?
    I may add that at some point, but many of the DBDs that this will be useful for (DBD::CSV, DBD::XBase, DBD::Excel, etc.) do not provide any useful metadata.
    > are you sure that a "SELECT *" will always give you something meaningful in $sth->{NAME} if there are no rows in the table
    It works for everything I've tried it on. If it doesn't work, the user just sets it manually.
    > I'm not sure defaulting to using the first column as the primary key is a great idea
    Well, Class:::DBI itself defaults to first column as primary key :-). I'm just making it explicit.