Hi,
I got into an interesting issue where I receive duplicated tables if I use
capital letters schema in reflect method.
Ubuntu 12.04 with packages
oracle-instantclient11.2-basiclite-11.2.0.3.0-1.i386.rpm,
oracle-instantclient11.2-devel-11.2.0.3.0-1.i386.rpm,
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.i386.rpm installed using
alien; Python 2.7; SQLAlchemy 0.7.9 and 0.8.2; cx-Oracle 5.1.2
DB is Oracle 11.2 XE on Windows with two simple tables and relation between
them
Customer >---- Address
Tables were created like: CREATE TABLE "MIKE"."CUSTOMER" ... so they should
be case insensitive.
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('oracle://mike:[email protected]/xe', echo=True)
Base = declarative_base(bind=engine)
Base.metadata.reflect(schema='mike')
tables = Base.metadata.tables.keys()
print tables
>>> [u'mike.customer', u'mike.address']
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('oracle://mike:[email protected]/xe', echo=True)
Base = declarative_base(bind=engine)
Base.metadata.reflect(schema='MIKE')
tables = Base.metadata.tables.keys()
print tables
>>> [u'MIKE.customer', u'MIKE.address', u'mike.address']
What I found in sqlalchemy code is that table mike.address is mapped and
added to Base.metadata.tables dictionary when table MIKE.customer is being
mapped. I guess that's because mike.address parent table to MIKE.customer.
The thing is it's added lowercase. Next, MIKE.address is added in a normal
way.
Well I'm not sure if this is a bug or I'm missing something, that's why I
would like to know your opinion on that.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.