Open jace opened 3 years ago
SQLAlchemy supports automatic type detection with foreign key columns:
class MyModel(Model): my_column = Column(None, ForeignKey('other_table.other_column'))
However this call variant is not present in the stubs. Mypy says:
error: No overload variant of "Column" matches argument types "None", "ForeignKey" [call-overload] note: Possible overload variants: note: def [_T] __init__(self, name: str, type_: Type[TypeEngine[_T]], *args: Any, autoincrement: Union[bool, str] = ..., default: Any = ..., doc: str = ..., key: str = ..., index: bool = ..., info: Mapping[str, Any] = ..., nullable: bool = ..., onupdate: Any = ..., primary_key: bool = ..., server_default: Any = ..., server_onupdate: Union[FetchedValue, FunctionElement[Any]] = ..., quote: Optional[bool] = ..., unique: bool = ..., system: bool = ..., comment: str = ...) -> Column[_T] note: def [_T] __init__(self, name: str, type_: TypeEngine[_T], *args: Any, autoincrement: Union[bool, str] = ..., default: Any = ..., doc: str = ..., key: str = ..., index: bool = ..., info: Mapping[str, Any] = ..., nullable: bool = ..., onupdate: Any = ..., primary_key: bool = ..., server_default: Any = ..., server_onupdate: Union[FetchedValue, FunctionElement[Any]] = ..., quote: Optional[bool] = ..., unique: bool = ..., system: bool = ..., comment: str = ...) -> Column[_T] note: <4 more similar overloads not shown, out of 6 total overloads>
This issue is distinct from #67 (Can't use ForeignKey in Column).
SQLAlchemy supports automatic type detection with foreign key columns:
However this call variant is not present in the stubs. Mypy says:
This issue is distinct from #67 (Can't use ForeignKey in Column).