[jifty-devel] Perhaps another bug :)

Joshua J. Kugler jkugler at bigfoot.com
Wed Mar 22 01:54:46 EST 2006

On Monday 20 March 2006 07:22, Jesse Vincent said something like:
> On Sun, Mar 19, 2006 at 06:19:39PM +1100, bart bunting wrote:
> > Hi yet again,
> >
> > It appears that it is not possible to have a column called order.
> The previous poster was correct. Jifty::DBI doesn't go to lengths to
> stop you from using an SQL reserved word for a column name, which
> means it might blow up. Should we be trying to protect you from
> yourself with a list of reserved words?
> (This is a serious question for everyone on the list)

And I have a serious answer (I hope).

My answer is: probably not.  Different DB systems can have different 
sets of reserved words due to implementing different parts of SQL92.  
So, trying to keep reserved word lists straight could be a nightmare.  
Also, what happens when someone starts using Jifty on a DB that doesn't 
have an official reserved word list?  If they are used to being 
"protected," then they may be in for a rude surprise.  I realize 
frameworks such as Jifty, Catalyst, RoR, Turbotgears, etc, are designed 
to lower the entry barrier for web apps, but I still think an 
application designer should know *something* about the underlying 
database he's using.  Most DB's have a section in their manual listing 
out all the reserved words.  See, for example, 
http://dev.mysql.com/doc/refman/4.1/en/reserved-words.html  So, it's 
not that hard to find out if a word you are using is reserved.  If in 
doubt, double up words.  For example, instead of "order" make your 
column name "item_order."  There are very few double word reserved 
words in SQL, and probably none that would clash with anything you'd 
come up with in most applications.

Possible idea: have a common denominator list, such as "select, insert, 
update, delete, order, group, from, etc."

Disclaimer:  I'm a system admin, programmer, web app designer and 
database admin.  You can take the above for what its worth. :)

j----- k-----

Joshua J. Kugler -- Fairbanks, Alaska -- ICQ#:13706295
Every knee shall bow, and every tongue confess, in heaven, on earth, and 
under the earth, that Jesus Christ is LORD -- Count on it!

More information about the jifty-devel mailing list