sqlalchemy-stubs icon indicating copy to clipboard operation
sqlalchemy-stubs copied to clipboard

Mypy plugin and stubs for SQLAlchemy

Results 96 sqlalchemy-stubs issues
Sort by recently updated
recently updated
newest added

These functions/classes/methods require better stubs (and most of them likely a plugin): * [ ] `Table` (+ likely a plugin) * [ ] `Connection`, `Index` * [x] `Column` * [...

enhancement
priority-normal
topic-plugins
topic-stubs

Imagine a type decorator: ```python class FancyDict(TypeDecorator[Dict[str, Any]]): impl = Unicode def process_bind_param(self, value, dialect): ... def process_result_value(self, value, dialect) -> Dict[str, Any]: # note non-optional return if value: return...

bug
priority-normal
topic-plugins

We could add a plugin that would allow to infer types for keys referenced by their names in other tables/models. This would likely require some extensive changes to mypy (because...

enhancement
priority-normal
topic-plugins

In particular there are few places where `str` vs `Text` is used arbitrarily.

priority-normal
needs discussion

There are no hints in PyCharm for models, which inherit declarative base from another module. Here is example: ```python # base.py import re from sqlalchemy import Column, Integer, DateTime from...

changed `plugins = sqlmypy` to `plugins = "sqlmypy"`

When I create a database following this guide: https://docs.sqlalchemy.org/en/20/orm/declarative_styles.html Mypy says imports are missing and missing argument. The code itself works but I get errors with mypy. I am using...

sqlalchemy documents it in the engine module

I tried to add `sqlalchemy-stubs` into my project and I experience problems with following construct: ``` db.execute(select(User).filter_by(id=user_id)) ``` mypy error is: ``` error: "Select" has no attribute "filter_by" [attr-defined] ```...

Hello, I've an interesting issue and a suggestion here. Next example is OK at runtime. It's connected with how SQLAlchemy initializes models when creates them using setattr or smth similar....