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

Hello,

i use Catalyst framework to generate automatically the objects related to the Oracle tables that are defined in my database.

I use this command to generate those objects:
./myapp_create.pl model DB DBIC::Schema MyApp::Schema create=static 'd +bi:Oracle:sid=mysid;host=57.5.189.39;port=1521' 'user' 'pwd'

The generation of all objects is successfull Except that if i look to the files .pm into the Schema directory, the property calls data_type, size, is_auto_increment, etc.. doesn't appear at all for each column.

For instance, i justr get this:
__PACKAGE__->add_columns( "user_id", "first_name", "last_name", "muid", "email_address", "picture", "location", "login", "password", "user_type_id", "permission_id", );
What shall i do to obtain the other properties associated to each column?

Is it a problem of Oracle user privilegies?

Thanks in advance

Best Regards

Didier

Replies are listed 'Best First'.
Re: DBIx::Class and Oracle
by stonecolddevin (Parson) on Feb 11, 2009 at 14:57 UTC

    Check out DBIx::Class::Schema::Loader.

    There is a method in there called make_schema_at that you can use to generate the full column definitions for your schema.

    Here is some example code:

    perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:./lib -e + 'make_schema_at("My::Schema", { debug => 1, db_schema => + "myschemaname", use_namespaces => 1, components => ["InflateColumn::DateTime"] }, ["dbi:Pg:host=localhost;dbname=mydbname", "user", "pass" + ])'

    Hope this helps.

    meh.