[Dbix-class] using reserved words for table names

Oleg Pronin syber.rus at gmail.com
Tue Mar 13 23:16:12 GMT 2007


You cannot use __PACKAGE__->storage->sql_maker because 'storage' doesn't yet
exist.
Use $schema->storage->sql_maker->quote_char('"'); after you connect your
schema to the database.
(possibly by redefining connect method in your schema class).

2007/3/13, icydee <dbix-class at iandocherty.com>:
>
> Hi.
> I would like to use a table named 'group' but of course it is a reserved
> word in MySql and so I must quote it.
>
> I thought I could use the following
> --------
>
> package MyApp::Schema;
> use strict;
> use base qw(DBIx::Class::Schema);
> __PACKAGE__->load_classes(qw(
>    Group
> ));
> __PACKAGE__->storage->sql_maker->quote_char('"');
> 1;
>
> ------
>
> In my schema base class but it came back with the error.
>
> Can't call method "sql_maker" on an undefined value...
>
> I can't find any further documentation on this. Any suggestions?
>
> Regards
> Ian Docherty (ICYDEE)
>
>
>
>
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive:
> http://www.mail-archive.com/dbix-class@lists.rawmode.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070314/b3c=
0360c/attachment.htm


More information about the Dbix-class mailing list