Hi all,
I'm using SQLObject as the database engine for a new CGI-based web app
framework I've been building.
On the whole, SQLObject is excellent, but there's a problem with the
.addColumn method.
At present, .addColumn does accept an 'updateSchema' keyword, which is
great. But there is no option to say 'only update the schema if the
schema doesn't already have that column'.
I'm writing to ask if .addColumn could be updated to also accept a
keyword like 'updateSchemaIfNeeded', which only changes the database
schema if the new column is not already present in the schema.
The absense of such ability creates a slight problem for my framework,
since I'm building in a facility to support extensions built by others,
and these extensions *must* have a trouble-free ability to add columns
to existing tables.
Without an 'updateSchemaIfNeeded' option, the best workaround I can
think of presently is for my framework to keep track of which extensions
are installed, and to pass a flag to each extension's constructor, along
the lines of:
def __init__(self, needSchemaUpdate):
"create an extension object"
...
# extend database
Person.sqlmeta.addColumn(
IntCol("income"),
updateSchema=needSchemaUpdate)
...
So if the extension is new and has not been 'installed', then the
framework would pass in True for needSchemaUpdate, otherwise if the
extension has already been installed, this flag would be False.
But it would be nice to not have to add this complication to extension
developers.
Thoughts?
Cheers
David
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss