sqlalchemy-stubs
sqlalchemy-stubs copied to clipboard
Mypy plugin and stubs for SQLAlchemy
Running the SQLAlchemy [`inspect`](https://docs.sqlalchemy.org/en/14/core/inspection.html#sqlalchemy.inspect) method on an existing MySQL server on a table with a column with an empty comment field is returning `comment=None` so I guess `comment` to be...
SQLAlchemy 1.4 release notes: https://docs.sqlalchemy.org/en/14/changelog/changelog_14.html#change-8dd50c1cc4d512bf97b23fb0243619af ``` Several operators are renamed to achieve more consistent naming across SQLAlchemy. The operator changes are: isfalse is now is_false isnot_distinct_from is now is_not_distinct_from istrue...
I have a model using PostgreSQL's UUID: ```python from sqlalchemy.dialects import postgresql class MyModel(Base): __tablename__ = 'my-model' some_id = Column(postgresql.UUID(as_uuid=True), nullable=False) ``` SQLAlchemy lets me create instances as follows: ```python...
I think a the select __init__ accepts a `Column` but, it isn't listed in the Union of types. It looks like an easy fix but, I don't know this well...
I'm using SQLAlchemy's `declared_attr` decorator to add columns and relationships. However, the decorated columns and relationships are completely ignored. Here is a very simplified reproducer: ```python from sqlalchemy.ext.declarative import declarative_base...
Hi. I'm getting this error when trying to use sqlalchemy.orm.Session as a context manager. **My code:** `with sa.orm.Session(some_app) as session:` **Errors:** error: "Session" has no attribute "__enter__"; maybe "__iter__"? error:...
The example in the docs shows a list of tuples of name/column pairs: ```pycon >>> x1, x2 = Column('x', Integer), Column('x', Integer) >>> cc = ColumnCollection(columns=[(x1.name, x1), (x2.name, x2)]) ```...
Given this file: ```python import sqlalchemy as sa sa.table("foo", schema="bar") ``` mypy with sqlalchemy-stubs plugin fails with: ``` $ mypy s.py s.py:3: error: Unexpected keyword argument "schema" for "TableClause" /site/venv/lib/python3.8/site-packages/sqlalchemy-stubs/sql/selectable.pyi:161:...
It seems the asyncio ext has no stubs.
As of 1.4, [`NoResultFound` has moved to `sqlalchemy.exc`](https://docs.sqlalchemy.org/en/14/core/exceptions.html?highlight=noresultfound#sqlalchemy.exc.NoResultFound)