Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sqlmodel/orm/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def exec(
```Python
heroes = session.exec(select(Hero)).all()
```
"""
""",
category=None,
)
def execute( # type: ignore
self,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import RelationshipProperty
from sqlmodel import Field, Relationship, Session, SQLModel, create_engine
from sqlmodel import Field, Relationship, Session, SQLModel, create_engine, select


def test_should_allow_duplicate_row_if_unique_constraint_is_not_passed(clear_sqlmodel):
Expand Down Expand Up @@ -31,7 +31,7 @@ class Hero(SQLModel, table=True):
session.refresh(hero_2)

with Session(engine) as session:
heroes = session.query(Hero).all()
heroes = session.exec(select(Hero)).all()
assert len(heroes) == 2
assert heroes[0].name == heroes[1].name

Expand Down Expand Up @@ -61,7 +61,7 @@ class Hero(SQLModel, table=True):
session.refresh(hero_2)

with Session(engine) as session:
heroes = session.query(Hero).all()
heroes = session.exec(select(Hero)).all()
assert len(heroes) == 2
assert heroes[0].name == heroes[1].name

Expand Down