2009/9/13 Alex <email@example.com>
How to use illegal names for MySQL with SQLObject?
In pure SQL it is possible to use backuotes, say:
SELECT `select from` FROM table1 WHERE 1;
...can be used to select the field called `select from`.
My situation is that I already have a DB which I'm trying to connect
with SQLObject to. MySQL throws an error because the table has illegal
Is it possible to tell SQLObject to utilize backquotes?
maybe you can just try to experiment with:
>>> class User(SQLObject):
(taken from http://www.sqlobject.org/SQLObject.html )
... class sqlmeta:
... # user is a reserved word in some databases, so we won't
... # use that for the table name:
... table = "user_table"
and with dbName
idType = str
idName = 'OID$CENKTGM01'
nazev = UnicodeCol(dbName="nazev", dbEncoding = "1250")
skupina = StringCol(length = 30)
You can also switch:
_connection.debug = True
You will see the SQL output. I have found it very useful.