Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Catalyst + PostgreSQL + DBIx::Class all schemas

by woodpeaker (Novice)
on Mar 06, 2009 at 18:26 UTC ( #748933=perlquestion: print w/replies, xml ) Need Help??
woodpeaker has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys,

I have completed PostgreSQL database. Also, in database I have many schemas which contain tables.

I didn't find any way to how to generate models from exists database (for all schemas, not just for public). Maybe anybody helps to me?

    schema_class => 'Trak::Scheme',
    connect_info => 
        { AutoCommit => 0 },
        {quote_char  => '"', name_sep    => q{.},'on_connect_do'=>'SET search_path TO trak,public'},

So that code not helps as on_connect request executing after all models generated + I would like to have all modules dynamicly (speed doesn't matter).

  • Comment on Catalyst + PostgreSQL + DBIx::Class all schemas

Replies are listed 'Best First'.
Re: Catalyst + PostgreSQL + DBIx::Class all schemas
by jasonk (Parson) on Mar 07, 2009 at 01:00 UTC

    From the docs for DBIx::Class::Schema::Loader:

    Currently the loader is limited to working within a single schema (using the database vendors' definition of "schema"). If you have a multi-schema database with inter-schema relationships (which is easy to do in PostgreSQL or DB2 for instance), you only get to automatically load the tables of one schema, and any relationships to tables in other schemas will be silently ignored.

    At some point in the future, an intelligent way around this might be devised, probably by allowing the db_schema option to be an arrayref of schemas to load.

    In "normal" DBIx::Class::Schema usage, manually-defined source classes and relationships have no problems crossing vendor schemas.

    So it can be done, but not by DBIx::Class::Schema::Loader, and therefore not automatically.
    We're not surrounded, we're in a target-rich environment!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://748933]
Approved by planetscape
[Corion]: ... the temporary tables, and also don't have a good idea on how to create unique table names for them
[hippo]: OIC. In that case leave it out but invite feature requests and see if any of the users suggest it. :-)
[Corion]: Talking about this makes me realize that it's likely only a half useful idea. But it still would be convenient to have as an option...
[Corion]: hippo: Hmmm - yeah, I could document it and wait for code implementing that option to show up ;-D

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2017-02-23 15:39 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (347 votes). Check out past polls.