ForeignKeyIterator iterates from or to a table by its foreign key constraints. This is a special type of SchemaIterator with the same interface, so it can be used in place of a SchemaIterator, but internally it functions very differently. Whereas a SchemaIterator is a real iterator that only gets the next schema object when called, a ForeignKeyIterator slurps the given SchemaIterator so it can discover foreign key constraints.
ForeignKeyIterator | ForeignKeyIterator iterates from or to a table by its foreign key constraints. |
Functions | |
new | |
next_schema_object | Return the next schema object or undef when no more schema objects. |
reset | |
_get_fk_refs | |
_recurse_fk_references | |
_d |
sub new
%args | Arguments |
db | Database of tbl. |
tbl | Table to iterate from to its referenced tables. |
Schema | Schema object. |
SchemaIterator | SchemaIterator object created with Schema and keep_ddl=>true. |
TableParser | TableParser object. |
Quoter | Quoter object. |
reverse | Iterate in reverse, from referenced tables to tbl. |
ForeignKeyIterator object
sub next_schema_object
Return the next schema object or undef when no more schema objects.
Hashref of schema object with at least a db and tbl keys, like
{ db => 'test', tbl => 'a', ddl => 'CREATE TABLE `a` ( ...', tbl_struct => <TableParser::parse()> hashref of parsed ddl, fk_struct => <TableParser::get_fks()> hashref of parsed fk constraints }
sub new
Return the next schema object or undef when no more schema objects.
sub next_schema_object
sub reset
sub _get_fk_refs
sub _recurse_fk_references
sub _d