Jonathan,
* It is caused by a subtle SQLAlchemy bug, when the quote argument is
ignored when the table name is in mixed case.*
As you suggested, I have created the simple example table object which
results in the table name in the SQL generated not being quoted (as
documented was the default)
Passing it quote=False; i.e.
users_table = Table('users', metadata,
Column('id', Integer, primary_key=True),
Column('name', String(40)),
Column('fullname', String(100)),
Column('password', String(15)),
quote=False
)
It likewise does not quote the table name.
If you pass "quote=True" instead, the table name is indeed quoted - so
SQLAlchemy seems to be behaving as documented, until you change the
table name to mixed case:
users_table = Table('usersTable', metadata,
Column('id', Integer, primary_key=True),
Column('name', String(40)),
Column('fullname', String(100)),
Column('password', String(15)),
quote=False
)
This results in the table name being quoted regardless; "quote=False"
is disregarded.
I am using mixed case for my Entities and thought that it did not
matter as Oracle ignores case *unless it is quoted*. (SQLite is case
insensitive whether it table names are quoted or not).
I'll raise this on the SQLAlchemy forum instead, but thought it was
worth writing up here in case it might help someone else tripped up by
this later.
Thanks for your help, regards,
Tim
On Apr 16, 3:08 pm, Jonathan LaCour <[EMAIL PROTECTED]>
wrote:
> Dr.T wrote:
> > Reading the SQLAlchemy docs, it states that quoting table (and
> > column) names defaults to False, but that it can be specified by
> > using the 'quote' table (and column) argument.
>
> > I assumed that whatever was causing the table name
> > to be quoted could therefore be stopped by using
> > 'using_table_options(quote=False)' in the Entity class definition.
>
> > This does not work however.
>
> > Has anyone any ideas on where the problem is or how to fix this?
>
> Well, we're definitely passing the options specified in
> `using_table_options` to the `Table` constructor, so I suspect
> something else is going on. Have you tried just creating a
> super-simple plain SQLAlchemy table object, passing it the
> `quote=False` keyword argument, and seeing if it behaves the same
> way? There's a bug somewhere, I'm just not sure its in Elixir.
>
> --
> Jonathan LaCourhttp://cleverdevil.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---