sqlalchemy-stubs
sqlalchemy-stubs copied to clipboard
Mypy plugin and stubs for SQLAlchemy
Would it be possible to make the type for `JSON` columns accept `Mapping[str, Any]` instead of (in addition to?) `Dict[str, Any]`? My specific use case is I have a fixed...
Hi! Thanks for this awesome project! I am [TypedDjango](https://github.com/TypedDjango) team member, we maintain types for, well, django. And we do pretty much the same job. For example, we also test...
We already support descriptor-like behavior and type inference for `Column`s. We need tests for this so that it will not regress. Depends on #2.
Here is a very simplified reproducer: ```python from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.schema import Column from sqlalchemy.types import Integer Base = declarative_base() class BaseMixin(Base): __abstract__ = True field1 = Column(Integer)...
For example `Column(ARRAY(Integer())).any` is `sqlalchemy.sql.sqltypes.ARRAY.Comparator.any`. We should support this. This requires both a plugin update and filling in comparator classes in stubs. This may be tricky because column types depend...
Our tests are configured so that Python 2 tests are skipped if Python 2 interpreter can't be found, somehow this happens on Travis.
Current mypy plugin system is practically ready for better support for this. Ideally we would want https://github.com/python/mypy/issues/6259 implemented. First thing here would be to infer `Column[str]` for `users.c.name` instead of...
A user should be able to annotate an argument/variable that is expected to take rows of a specific table/join/etc. For example: ```python class BasicData(SQLResult): id: int name: str ``` We...
We need to add a simple plugin that would replace `Column[X]` with `InstrumentedAttribute[Column[X], X]` and make the latter a descriptor instead instead of the former. In addition the plugin would...
These modules require special attention: * [ ] `engine/base.pyi` * [ ] `engine/result.pyi` * [ ] `util/_collections.pyi` * [x] `sql/base.pyi` * [x] `sql/compiler.pyi` * [x] `sql/ddl.pyi` (?) * [ ]...