[Dbix-class] Automatic quoting

Darren Duncan darren at darrenduncan.net
Wed Jun 9 03:51:50 GMT 2010


Toby Corkindale wrote:
> 1) You shouldn't be making db tables or columns based on reserved words 
> anyway, as sooner or later someone will want to log in manually to do 
> something in SQL, and be cursing you.

A problem with reserved words is that they keep changing as you upgrade your 
DBMS or switch between DBMSs; each version has distinct reserved words in the 
general case, and even if you avoid any now, you may come into conflict simply 
by upgrading the DBMS.

Another problem with reserved words is that many times it is reasonable to name 
an identifier something that is the same as a reserved word, because that is the 
best description of what is being identified.

If a programming language is well-designed, it wouldn't have any reserved words 
because its syntax can tell keywords apart from identifiers just based on their 
position in code.  For example, in Perl you could say "sub sub { sub( $sub ) }" 
and there's no ambiguity as to what that means, I believe.

-- Darren Duncan




More information about the DBIx-Class mailing list