September 28th, 2006

angle brackets, fed up, html

Death to reserved words

Knightley has a feature called "groups". This has proven to be a huge liability.

You see, SQL (the language used to talk to databases) has a feature called GROUP BY. I won't bother explaining what it does, but there's basically only one place in SQL where you could possibly use the word "GROUP" (or "group" or "GrOUp", since SQL is case-insensitive) to access that feature.

Naturally, having a feature called "groups", I want to be able to call things in my database "group". Unfortunately, for some insane reason, SQL uses reserved words--meaning that using "GROUP" in any context, even one that clearly has nothing to do with GROUP BY, is verboten. There are quoting mechanisms for getting around this, but they vary from database to database, so the library I'm using doesn't try to support them.

And now it's having trouble renaming a column named 'group' to 'groupid' for some reason...

Ugh.