Skip to content

Commit 226009f

Browse files
fastapi-sqlalchemy-pg-catalog/app: drop redundant future=True on create_engine
SQLAlchemy 2.x defaults to the future-2.0 behaviour; passing `future=True` is redundant and can trip a deprecation warning in some 2.x point releases. Dropped to keep the sample free of incidental warning noise that would distract from the dispatcher-bug repro. Refs Copilot review on #102. Signed-off-by: Akash Kumar <meakash7902@gmail.com>
1 parent 4316715 commit 226009f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • fastapi-sqlalchemy-pg-catalog/app

fastapi-sqlalchemy-pg-catalog/app/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ class Project(Base):
6565
name = Column(String(100), nullable=False)
6666

6767

68-
engine = create_engine(DATABASE_URL, echo=SQL_ECHO, future=True)
68+
# SQLAlchemy 2.x defaults to the future-2.0 behaviour, so no
69+
# `future=True` is needed (and passing it can trip a deprecation
70+
# warning depending on the installed minor version).
71+
engine = create_engine(DATABASE_URL, echo=SQL_ECHO)
6972

7073

7174
@asynccontextmanager

0 commit comments

Comments
 (0)