[kforge-dev] Changeset [68]: Added support for avoiding collisions of model names with RDBMS reserved ...

Rufus Pollock rufus.pollock at okfn.org
Mon Dec 11 11:40:55 UTC 2006


John Bywater wrote:
> So I tried to fix this because I suddenly realised that it would be 
> because all SQLObjects were having their 'table' attribute set, and so 
> the SQLObject name conversion routines were always being bypassed. So I 
> thought it wouldn't take too long. But it I did end up spending about 5 
> or 6 hours on it the other day.

Much appreciated though it does make me wonder whether it might not have 
been better to stick with the simple renaming of 'key' in session rather 
than developing a 'general' solution. This issue seems to have been 
debated elsewhere, e.g.:

   http://trac.turbogears.org/turbogears/ticket/201

with the consensus there that it was better something left to the user 
to avoid clashes. That said I can see the attraction of the argument 
that the user of the domain model should be able to be entirely 
independent of db constraints -- though one could achieve this by giving 
domain model users access to the sqlmeta class (at the cost of requiring 
some awareness of the constraints on the behalf of dm users).

> I discovered that the SQLObject actually uses one of a number of styles 
> to convert names, so they are now being used. The style object is in 
> different places in SQLObject v0.6 and v0.7. But I included support for 
> both versions.

Yes I'd seen that around already when reading the sqlobject docs. Sounds 
useful though a slight pain that in two different places in recent 
sqlobject versions ...

> Does this work with an upgraded knowledgeforge.net service now?

Checking the table names in the db it looks like that is fixed. Though 
there were some other issues but these have now been fixed I think 
looking at the recent commits.

> 
> PS Might you be able to locate proper lists of database keywords, for 
> standard SQL, for postgres, for mysql? I looked but couldn't find 
> anything normative (did have the idea afterwards to get and grep through 
> the respective source package files but didn't so far).

These look good:

http://developer.mimer.com/validator/sql-reserved-words.tml
http://developer.mimer.com/validator/parser200x/vendor-reserved-words-sql200x.tml

Regards,

Rufus




More information about the kforge-dev mailing list