On 7 Dec 2006, at 16:58, Marc Espie wrote:

On Thu, Dec 07, 2006 at 05:20:36PM +0100, Robert 'phaylon' Sedlacek wrote:
Marc Espie wrote:
The requests generated by DBIx::Class do not quote field names by default. Is there a way to get them quoted ? Even though this generates less readable
SQL, this can be useful in some cases...

It's even in the documentation:
http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/ Cookbook.pod#Setting_quoting_for_the_generated_SQL.

Thanks! next question, is there any way to do that automatically ? I come
from the old DBI, which often knows about the correct quote chars for
the database... I don't quite understand why this is not automatic ?

Auto-selecting the correct quote chars is implementable.

Automatically turning quoting on isn't something we're going to do, due to it (a) being a noticeable performance hit to SQL generation, (b) not being backwards compatible (I've seen a fair number of evil tricks in production code that would break if we made everything quote by default, and one of DBIC's appeals is that we live with our mistakes in that sort of direction rather than pulling the rug out from under people :)

--
Matt S Trout, Technical Director, Shadowcat Systems Ltd.
Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ +



_______________________________________________
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/[email protected]/

Reply via email to