[Dbix-class] DBIx::Class::Schema::Loader: table names in generated classes

Jose Fonseca zefonseca at gmail.com
Mon Jan 24 02:28:05 GMT 2011


Hello Jorge,
 to test if this is really your issue, choose one of the generated classes
and change the

__PACKAGE__->table("table");

to

__PACKAGE__->table("SCHEMA.table");

If it solves your problem for that particular class, then you'll be sure
about the cause and you can fix the others accordingly.

I'm not 100% sure about the Oracle syntax, but you can probably set the
default schema on the DBI connection string passed to
Your_Base_DBIx_Class->connect(); ( See
http://search.cpan.org/~abraxxa/DBIx-Class-0.08127/lib/DBIx/Class/Storage/D=
BI.pm#connect_info)

Regards,
Jose

On Sun, Jan 23, 2011 at 5:49 PM, Jorge Gonzalez <jorge.gonzalez at daikon.es>w=
rote:

>  Hi,
>
> first, let me apologize in advance if this issue has been brought up on t=
he
> list before. I haven't been able to find a solution to my problem (googled
> for it for a couple of hours), though I think it's a pretty easy one and
> probably someone has stepped into it.
>
> This is the story:
>
> I have a running Oracle schema, for which I have a readonly user. The
> tables are owned by user OWNER, but I have user READER to access them.
> READER has a readonly access to the tables.
>
> I have generated the schema classes though DBIx::Class::Schema::Loader (v=
ia
> the Catalyst helper script). I needed the special option "db_schema=3DOWN=
ER"
> to correctly generate the classes, since READER owns no tables, but has
> access to them. The generated classes have correct
> "...->table('my_table_name')" sentences.
>
> But whenever I try to use the schema classes, they don't work and give
> exceptions about 'table my_table_name does not exist in current schema'. I
> believe this is due to the table name being specified as 'my_table_name',
> and not 'OWNER.my_table_name' in the '...->table(' function call, since I
> have manually modified the class to be like the latter, and it works this
> way.
>
> I'd like to know where can I put the equivalent "db_schema=3DOWNER" or
> equivalent option, so that all the schema classes use the tables from the
> OWNER schema, despite connecting to the database with the READER user.
>
> Thanks in advance
> Best regards
> Jorge
>
> --
>
>    *Jorge Gonz=E1lez Villalonga*
> Director T=E9cnico
>
> *DAIKON Integraci=F3n y Desarrollo S.L.*
> Telf: (+34) 91 188 08 28
> Fax: (+34) 91 632 65 42
> *www.daikon.es*
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20110124/95a=
fa809/attachment.htm


More information about the DBIx-Class mailing list