On Tue, Jul 12, 2011 at 10:45:56PM +0100, Timothy W. Grove wrote:
> Thanks for your advice, Oleg, but could you help me out just a little
> bit more? By 'You must drop it yourself', are you meaning that I need to
> go back to using plain old SQL? (I haven't had to do that for awhile
> thanks to SQLObject!!!)
Yes, plain old SQL. SQLObject doesn't map any Python operation to SQL
or any SQL to Python (no ORM does due to impedance mismatch). SQLObject
maps only limited subsets of operations, and the area of schema changes
is very limited.
Plain old SQL and perhaps tricky one. Can I ask - what backend
do you use, MySQL?
> Can I issue SQL commands to my database through
> SQLObject? Thanks again for your help.
Yes, from a script or even from python interactive prompt. Just open
your connection the way you do in your programs and call
connection.query() or connection.queryAll(). Examples:
from sqlobject import connectionForURI
connection = connectionForURI('mysql://...')
print connection.queryAll('SHOW INDEX FOR sentence')
connection.query('DROP INDEX sentence_video_unique')
Oleg Broytman http://phdru.name/ phd@...
Programmers don't die, they just GOSUB without RETURN.