bsb has asked for the wisdom of the Perl Monks concerning the following question:

I just started playing with it and the new_native method doesn't seem to work, there's no columns in the patient table. It is only version 0.21, is the module actually supposed to work?

Is there a better DBI automatic metadata module?

$ perl -MDBIx::DBSchema -e 'print DBIx::DBSchema->new_native("dbi:mysq +l:ahp")->pretty_print' | head -n 20 'patient' => { 'columns' => [ ], 'primary_key' => 'id', 'unique' => [ [ 'patient_key', 'div_id' ] ], 'index' => [ ], }, 'gp' => { 'columns' => [ 'id', 'int', '', '11', '', 'auto_increment', 'div_id', 'int', '', '11', '0', '', 'name', 'text', '', '', '', '', 'display', 'tinyint', 'NULL', '1', '0', '', ], 'primary_key' => 'id', 'unique' => [ ], 'index' => [ ], },

Replies are listed 'Best First'.
(jeffa) Re: Anyone using DBIx::DBSchema + MySQL?
by jeffa (Bishop) on Jun 20, 2003 at 14:05 UTC
    This worked for my test case. Have you tried something like:
    mysql -e'desc patient' -D ahp
    to see a listing of the fields for that table? Perhaps that table is a MySQL table type that is not compatible with DBIx::DBSchema - i doubt it ...

    As an alternative, have you tried DBI::Wrap or the more complex DBI::Class?

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      The table is there, has data and can be used with straight DBI, Class::DBI and even by Class::DBI::mysql which gets the schema automatically.

      DBIx::DBSchema seems to misparse or lose track of something since column types show up as column names. I haven't investigated very deeply yet. I probably never will, the module smells a bit funny.

      Thanks for checking anyway.

      Brad