summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-05-18 16:08:33 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-05-18 16:21:54 -0400
commit53af60b3536221f2503af29c1e90cf9db1295faf (patch)
tree13d5e142ed0759e63fb4fee7aa244519703e42ed /lib/sqlalchemy/sql/schema.py
parentde1fd55af4ef352ebbc95e03d868aab2995a8261 (diff)
downloadsqlalchemy-53af60b3536221f2503af29c1e90cf9db1295faf.tar.gz
Streamline visitors.iterate
This method might be used more significantly in the ORM refactor, so further refine it. * all get_children() methods now work entirely based on iterators. Basically only select() was sensitive to this anymore and it now chains the iterators together * remove all kinds of flags like column_collections, schema_visitor that apparently aren't used anymore. * remove the "depthfirst" visitors as these don't seem to be used either. * make sure select() yields its columns first as these will be used to determine the current mapper. Change-Id: I05273a2d5306a57c2d1b0979050748cf3ac964bf
Diffstat (limited to 'lib/sqlalchemy/sql/schema.py')
-rw-r--r--lib/sqlalchemy/sql/schema.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py
index 08dc487d4..8d28d6309 100644
--- a/lib/sqlalchemy/sql/schema.py
+++ b/lib/sqlalchemy/sql/schema.py
@@ -117,10 +117,6 @@ class SchemaItem(SchemaEventTarget, visitors.Visitable):
else:
spwd(self)
- def get_children(self, **kwargs):
- """used to allow SchemaVisitor access"""
- return []
-
def __repr__(self):
return util.generic_repr(self, omit_kwarg=["info"])
@@ -820,21 +816,6 @@ class Table(DialectKWArgs, SchemaItem, TableClause):
metadata._add_table(self.name, self.schema, self)
self.metadata = metadata
- def get_children(
- self, column_collections=True, schema_visitor=False, **kw
- ):
- # TODO: consider that we probably don't need column_collections=True
- # at all, it does not seem to impact anything
- if not schema_visitor:
- return TableClause.get_children(
- self, column_collections=column_collections, **kw
- )
- else:
- if column_collections:
- return list(self.columns)
- else:
- return []
-
@util.deprecated(
"1.4",
"The :meth:`_schema.Table.exists` method is deprecated and will be "
@@ -1656,16 +1637,6 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause):
selectable.foreign_keys.update(fk)
return c.key, c
- def get_children(self, schema_visitor=False, **kwargs):
- if schema_visitor:
- return (
- [x for x in (self.default, self.onupdate) if x is not None]
- + list(self.foreign_keys)
- + list(self.constraints)
- )
- else:
- return ColumnClause.get_children(self, **kwargs)
-
class ForeignKey(DialectKWArgs, SchemaItem):
"""Defines a dependency between two columns.