[Dbix-class] Prefetch problem

peter at dragonstaff.com peter at dragonstaff.com
Thu Oct 2 16:50:23 BST 2008


In theory you can set quoting on table and field names:
http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/Manual/Cookbook.pod#Setting_quoting_for_the_generated_SQL.

In practice, though, that doesn't work 100% on DBs like Oracle and  
it's hard to
spot all the reserved words so it may be easier on the sanity to use a table
prefix in your schema definition, like the following:

package Schema::User;
use base qw(DBIx::Class);
...
__PACKAGE__->table('az_user'); # reserved Oracle keyword 'user' is no good as
table name

then in caller:

my $rs = $self->schema->resultset('User')->find( 'foo' );

Regards, Peter
http://perl.dragonstaff.co.uk


Quoting Jesse Sheidlower <jester at panix.com>:

>> try aliasing the table to grp instead of group, my guess is that  
>> group is a reserved word
> Uh, yeah, that would be it.






More information about the DBIx-Class mailing list