Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^6: Using DBIx::Class::Schema::Loader to determine constraints

by jds17 (Pilgrim)
on Nov 01, 2012 at 21:04 UTC ( #1001871=note: print w/replies, xml ) Need Help??

in reply to Re^5: Using DBIx::Class::Schema::Loader to determine constraints
in thread Using DBIx::Class::Schema::Loader to determine constraints

I have just tried out what you wrote in your last post and I like the idea of doing it this way. To be more specific what I tried out was:

use strict; use warnings; use DBI; use SQL::Translator; my $dbh = DBI->connect( 'dbi:Pg:dbname=playground', 'postgres', '***** +**' ); my $translator = SQL::Translator->new( parser => 'DBI', parser_args => { dbh => $dbh, } ); $translator->translate(); my $schema = $translator->schema; for my $rsrc_name ( $schema->get_tables() ) { my $rsrc = $schema->get_table($rsrc_name); ... } ...

The Pg support indeed is not complete, I had tested with a table having a two-column primary key and the parse() method of SQL::Translator::Parser::DBI::PostgreSQL failed (currently it only works on one-column pkeys).

I have posted a bug report and a proposal for a patch on (see here). The bug was easy to fix. So one possibility would be to continue with my database-wise handling and the other to help out finding and maybe help fixing remaining bugs in the SQL::Translator::Parser::DBI::XXXXX modules.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001871]
shmem is an "instant asshole - just add alcohol" :-P
[james28909]: you guys/gals are awesome. thanks for the wisdom.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2018-05-20 16:07 GMT
Find Nodes?
    Voting Booth?