After a little search, I found that the problem is due to line 684 of the file C:\Python27\Lib\site-packages\sqlalchemy\dialects\sqlite\base.py. The column names of the table are processed with this regular expression command:
name = re.sub(r'^\"|\"$', '', name) which substitutes the first double quotes with a blank. Is this really necessary? Does there exist any workaround to overcome this problem? Il giorno martedì 18 settembre 2012 18:21:36 UTC+2, Massi ha scritto: > > Hi everyone, I'm using sqlalchemy 0.7.8 with sqlite and I'm encountering a > problem trying to retrieve data from a table having a column named > "input"_1. If I run this simple code: > > from sqlalchemy import * > > db = create_engine('sqlite:///test.db') > db.echo = False > metadata = MetaData(db) > t = Table('my_table', metadata, autoload=True) > print t.select().execute() > > i get the following error: > OperationalError: (OperationalError) no such column: my_table.input"_1 > u'SELECT my_table.id, my_table.input"_1 FROM my_table'. It seems that the > first double quotes are truncated by the query function. Of course I can > arrange things such that no double quotes are present in column names, but > I would like to know if SA can somehow handle this situation automatically > and in a platform-independent way. > Thanks in advance for your help! > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/0aCst9j8XcgJ. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.