Patches item #2883211, was opened at 2009-10-21 17:10
Message generated for change (Settings changed) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2883211&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Matt Domsch (mdomsch)
Assigned to: Nobody/Anonymous (nobody)
Summary: executing scripts with sqlite backend
Initial Comment:
When trying to execute a multi-line sql script using sqlobject-admin upgrade, sqlobject fails
Traceback (most recent call last):
File "/usr/bin/tg-admin", line 8, in <module>
load_entry_point('TurboGears==1.0.8', 'console_scripts', 'tg-admin')()
File "/usr/lib/python2.5/site-packages/turbogears/command/base.py", line 400, in main
command.run()
File "/usr/lib/python2.5/site-packages/turbogears/command/base.py", line 138, in run
command.the_runner.run(sys.argv)
File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 101, in run
runner.run()
File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 307, in run
self.command()
File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 1191, in command
conn.query(sql)
File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 337, in query
return self._runWithConnection(self._query, s)
File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 250, in _runWithConnection
val = meth(conn, *args)
File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 334, in _query
self._executeRetry(conn, conn.cursor(), s)
File "/usr/lib/python2.5/site-packages/sqlobject/sqlite/sqliteconnection.py", line 197, in _executeRetry
raise Warning(ErrorMessage(e))
sqlobject.dberrors.Warning: You can only execute one statement at a time.
However, for updating database schemas, I need to be able to execute more than one statement at a time.
Patch attached looks at the query string for multiple lines, and if so, calls executescript() instead of execute().
----------------------------------------------------------------------
Comment By: Oleg Broytman (phd)
Date: 2009-12-14 21:50
Message:
I am not sure how to accept the patch. First, shouldn't SQL statements be
separated by a semicolon (';'), not a eoln? Second, isn't SQLiteConnection
too low-level for the patch? Shouldn't it be fixed somewhere higher so any
backend can accept mutlistatment script?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2883211&group_id=74338
|