MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _refresh_for_new_column

Method _refresh_for_new_column

lib/sqlalchemy/sql/selectable.py:1053–1078  ·  view source on GitHub ↗

Given a column added to the .c collection of an underlying selectable, produce the local version of that column, assuming this selectable ultimately should proxy this column. this is used to "ping" a derived selectable to add a new column to its .c. collection when a

(self, column: ColumnElement[Any])

Source from the content-addressed store, hash-verified

1051 """
1052
1053 def _refresh_for_new_column(self, column: ColumnElement[Any]) -> None:
1054 """Given a column added to the .c collection of an underlying
1055 selectable, produce the local version of that column, assuming this
1056 selectable ultimately should proxy this column.
1057
1058 this is used to "ping" a derived selectable to add a new column
1059 to its .c. collection when a Column has been added to one of the
1060 Table objects it ultimately derives from.
1061
1062 If the given selectable hasn't populated its .c. collection yet,
1063 it should at least pass on the message to the contained selectables,
1064 but it will return None.
1065
1066 This method is currently used by Declarative to allow Table
1067 columns to be added to a partially constructed inheritance
1068 mapping that may have already produced joins. The method
1069 isn't public right now, as the full span of implications
1070 and/or caveats aren't yet clear.
1071
1072 It's also possible that this functionality could be invoked by
1073 default via an event, which would require that
1074 selectables maintain a weak referencing collection of all
1075 derivations.
1076
1077 """
1078 self._reset_column_collection()
1079
1080 def _anonymous_fromclause(
1081 self, *, name: Optional[str] = None, flat: bool = False

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected