title: SQLAlchemy: reflect table into explicitly created class
body: <p>Suppose I have two schemas in the single PostgreSQL database and each schema contain table with the same name. For example: schema1.table, schema2.table.</p>
  
  <p>I use SQLAlchemy for working with the database.</p>
  
  <p>The first issue is that I can't reflect table from database specifying concrete schema into explicitly created class. For example:</p>
  
  <pre><code>from sqlalchemy import create_engine
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.ext.declarative import DeferredReflection
  
  Base = declarative_base()
  
  class Table(DeferredReflection, Base):
      __tablename__ = 'table'
  
  ## somehow specify schema for table
  
  engine = create_engine(
      'postgresql+psycopg2://localhost/postgres',
      isolation_level='READ UNCOMMITTED'
  )
  
  DeferredReflection.prepare(engine)
  
  ## do something using reflected table
  </code></pre>
  
  <p>The second issue is that I am looking for a way to bind one explicitly created class with tables from different schemas and use it as follows:</p>
  
  <pre><code>session = Session()
  with schema_context('schema1'):
      data = session.query(Table).all()  # Table refers to schema1.table 
      ...
  
  with schema_context('schema2'):
      data = session.query(Table).all() # Table refers to schema2.table
      ...
  </code></pre>
  
  <p>Is there some way to work around or solve described issues?</p>