Re: [SQLObject] syntax error exception on sqlite database?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2010-08-04 11:18:22
|
On Wed, Aug 04, 2010 at 03:50:53AM -0700, Dominic LoBue wrote: > CREATE TABLE "chrFactions" ( [skip] > PRIMARY KEY ("factionID") > ) > > > And here's my definition: > class chrFactions(SQLObject): > class sqlmeta: > style = MixedCaseStyle(longID=True) > idName = 'factionID' > fromDatabase = True > > However SQLObject clearly thinks there's a PRIMARY column for some reason: SQLObject's fromDatabase machinery is quite primitive and doesn't support all of the backend features. In this case it sees the line > PRIMARY KEY ("factionID") and decides it is a column. To work around the problem add the following parameter to SQLiteConnection constructor: use_table_info=True; if you use DB URIs add '&use_table_info=1'. This switches SQLiteConnection to a different, more clever parser. In the future I'm going to make that the default; the switch is at the top of my TODO. Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |