On Mon, 13 Dec 2004 22:59:52 -0200, Carlos Ribeiro <car...@gm...> wrote:
> I'm trying to trace it down, but that's
> the first time I'm trying to understand SQLBuilder internals, so I
> thought that it would be good to report it.
I think I'm beginning to understand how do SQLBuilder works, but
still, I have no idea on how to solve this problem. The SQLExpression
class has this code:
def __str__(self):
return self.__sqlrepr__(None)
That's the code that is called, and it passes None as the db, in this
case. But the StringLikeConverter (that is the converter that it finds
in the registry for a constant string) expects a valid db name:
def StringLikeConverter(value, db):
if db in ('mysql', 'postgres'):
for orig, repl in sqlStringReplace:
value = value.replace(orig, repl)
elif db in ('sqlite', 'firebird', 'sybase', 'maxdb'):
value = value.replace("'", "''")
else:
assert 0, "Database %s unknown" % db
return "'%s'" % value
And that's where the assertion happens. What can I do in this case?
I'm really lost and looking for ideas :-) I could possibly initialize
the SQLExpression object with a valid db name (borrowed from the best
possible candidate it finds while building the expression), but I'm
not sure about the side effects.
--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: car...@gm...
mail: car...@ya...
|