sqlalchemy-stubs
sqlalchemy-stubs copied to clipboard
Mypy plugin and stubs for SQLAlchemy
Hi, I have a small problem, my models and the app using them are in different packages. Mypy detects errors in the package with my models, but does not detect...
Probably doing something wrong here, but I can't figure out how to make this work: ```python class EncryptedType(TypeDecorator): impl = LargeBinary def __init__(self, engine: EncryptionEngine, **kwargs: Any) -> None: super().__init__(**kwargs)...
Currently, the `process_bind_param` method on `TypeDecorator[_T]` has signature: https://github.com/dropbox/sqlalchemy-stubs/blob/8495c229cf8a31d75fcea36090e07c0e4b867605/sqlalchemy-stubs/sql/type_api.pyi#L95 Unfortunately, it looks like this is incorrect: I believe it can return anything that the underlying `impl` can accept. For instance,...
I'm happy to write a first draft of this if the maintainers would like it. But I don't want to put in the effort if it's not wanted. I've run...
Those versions will introduce massive api changes, will this package support them? If so, has work towards that started?
Hi, I saw the thread a this topic [here](https://github.com/python/mypy/issues/4430), but can't haven't seen any TODOs in this repo for it, so I'll go ahead and make one. We need support...
I'm getting `error: Unexpected keyword argument "astext_type" for "JSONB"` in my alembic migrations on lines like: `sa.Column("data", postgresql.JSONB(astext_type=sa.Text()), nullable=True),` Looking at the [__init__](https://github.com/sqlalchemy/sqlalchemy/blob/rel_1_4_0b1/lib/sqlalchemy/dialects/postgresql/json.py#L183) function of the JSON class that JSONB...
For example, the following code fails to validate: ```python from sqlalchemy.orm import backref, relationship from sqlalchemy.sql.schema import Column, ForeignKey from sqlalchemy.sql.sqltypes import Integer from sqlalchemy.ext.declarative import declarative_base Base = declarative_base()...
SQLAlchemy supports automatic type detection with foreign key columns: ```python class MyModel(Model): my_column = Column(None, ForeignKey('other_table.other_column')) ``` However this call variant is not present in the stubs. Mypy says: ```...
Thank you for this project. Is it possible to provides stubs for [Flask-SQLAlchemy](http://flask-sqlalchemy.pocoo.org/2.3/) as well?