diff options
Diffstat (limited to 'lib/sqlalchemy/sql/_typing.py')
-rw-r--r-- | lib/sqlalchemy/sql/_typing.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/_typing.py b/lib/sqlalchemy/sql/_typing.py index f49a6d3ec..ed1bd2832 100644 --- a/lib/sqlalchemy/sql/_typing.py +++ b/lib/sqlalchemy/sql/_typing.py @@ -61,6 +61,9 @@ if TYPE_CHECKING: _T = TypeVar("_T", bound=Any) +_CE = TypeVar("_CE", bound="ColumnElement[Any]") + + class _HasClauseElement(Protocol): """indicates a class that has a __clause_element__() method""" @@ -68,6 +71,13 @@ class _HasClauseElement(Protocol): ... +class _CoreAdapterProto(Protocol): + """protocol for the ClauseAdapter/ColumnAdapter.traverse() method.""" + + def __call__(self, obj: _CE) -> _CE: + ... + + # match column types that are not ORM entities _NOT_ENTITY = TypeVar( "_NOT_ENTITY", |