[Dbix-class] Please Help
Oleg Pronin
syber.rus at gmail.com
Fri Apr 6 09:07:02 GMT 2007
You can use qouting feature in SQL::Abstract;
If you do
$schema->storage->sql_maker->quote_char('`');
$schema->storage->sql_maker->name_sep('.');
Then every column in your queries will be quoted.
2007/4/6, quqi xiao <xiaoquqi at gmail.com>:
>
> When I use dbix::class,I meet a problem.
> This is the structure of my table in MySQL
> create table test_table(
> id int,
> group int
> )
>
> and I used dbix::class to create a package like this:
> __PACKAGE__->add_columns(qw/ id group/);
>
> And When I use the add_to... to insert the record.An error happened.
> INSERT INTO(id,group)values(1,1).
> I copy this to my mysql tool and change it to:
> INSERT INTO(id,`group`)values(1,1)
> Everything will be ok.` is a transferred meaning sign in Mysql and group
> is a key word in Mysql.
> Is there any *mechanism* in DBIx::class to avoid this problem?Thank you
> very much.Hope your reply.
>
>
> _______________________________________________
> 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/20070406/236=
f9228/attachment.htm
More information about the Dbix-class
mailing list