From: David McNab <david@re...> - 2006-04-09 23:58:44
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
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
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
On Mon, Apr 10, 2006 at 11:53:29AM +1200, David McNab wrote:
> 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'.
Interesting idea. Would you like to write a patch?
Oleg Broytmann http://phd.pp.ru/ phd@...
Programmers don't die, they just GOSUB without RETURN.