acquired using the new inspect() service,
part of [ticket:2208]
+ - [feature] The column_reflect event now
+ accepts the Inspector object as the first
+ argument, preceding "table". Code which
+ uses the 0.7 version of this very new
+ event will need modification to add the
+ "inspector" object as the first argument.
+ [ticket:2418]
+
- [bug] Removed warning when Index is created
with no columns; while this might not be what
the user intended, it is a valid use case
found_table = False
for col_d in self.get_columns(table_name, schema, **tblkw):
found_table = True
- table.dispatch.column_reflect(table, col_d)
+ table.dispatch.column_reflect(self, table, col_d)
name = col_d['name']
if include_columns and name not in include_columns:
"""
- def column_reflect(self, table, column_info):
+ def column_reflect(self, inspector, table, column_info):
"""Called for each unit of 'column info' retrieved when
a :class:`.Table` is being reflected.
from sqlalchemy.schema import Table
from sqlalchemy import event
- def listen_for_reflect(table, column_info):
+ def listen_for_reflect(inspector, table, column_info):
"receive a column_reflect event"
# ...
...or with a specific :class:`.Table` instance using
the ``listeners`` argument::
- def listen_for_reflect(table, column_info):
+ def listen_for_reflect(inspector, table, column_info):
"receive a column_reflect event"
# ...
from sqlalchemy.schema import Table
m = MetaData(testing.db)
- def column_reflect(table, column_info):
+ def column_reflect(insp, table, column_info):
if column_info['name'] == col:
column_info.update(update)