Ejemplo n.º 1
0
 def _get_table_counts(self):
     engine = sqlalchemy_api.get_engine()
     conn = engine.connect()
     meta = MetaData(engine)
     meta.reflect()
     shadow_tables = sqlalchemy_api._purgeable_tables(meta)
     results = {}
     for table in shadow_tables:
         r = conn.execute(select([func.count()
                                  ]).select_from(table)).fetchone()
         results[table.name] = r[0]
     return results
Ejemplo n.º 2
0
 def _get_table_counts(self):
     engine = sqlalchemy_api.get_engine()
     conn = engine.connect()
     meta = MetaData(engine)
     meta.reflect()
     shadow_tables = sqlalchemy_api._purgeable_tables(meta)
     results = {}
     for table in shadow_tables:
         r = conn.execute(
             select([func.count()]).select_from(table)).fetchone()
         results[table.name] = r[0]
     return results