SQLAlchemy patterns — engine setup, session management, declarative models,
98
99%
Does it follow best practices?
Impact
98%
1.96xAverage score across 5 eval scenarios
Passed
No known issues
create_async_engine used (not sync)
100%
100%
async_sessionmaker used (not sync sessionmaker)
100%
100%
expire_on_commit=False on async sessionmaker
100%
100%
pool_pre_ping enabled
0%
100%
Pool size and overflow configured
0%
0%
Mapped types used (not Column)
100%
100%
select() API used (not query())
100%
100%
back_populates used (not backref)
100%
100%
cascade='all, delete-orphan' on User.notifications
0%
100%
Database URL from environment
0%
100%
Async session dependency uses async with
100%
100%
DeclarativeBase used (not declarative_base)
100%
100%
Mapped types used (not Column)
100%
100%
expire_on_commit=False
0%
100%
Pool configuration complete
0%
100%
Eager loading on get_published_posts
0%
100%
cascade='all, delete-orphan' on parent relationships
0%
100%
ondelete='CASCADE' on ForeignKeys
0%
100%
back_populates used (not backref)
100%
100%
select() API used
100%
100%
Database URL from environment
100%
100%
Session yield/finally cleanup
100%
100%
Bulk insert used (not individual add in loop)
81%
100%
IntegrityError caught for duplicate SKU
0%
100%
pool_pre_ping enabled
0%
100%
Pool size and overflow configured
0%
100%
Mapped types used (not Column)
0%
100%
Session yield/finally cleanup
100%
100%
No raw SQL f-strings
100%
100%
Database URL from environment
100%
100%
DeclarativeBase used
100%
100%
expire_on_commit=False
0%
100%
back_populates on relationships
100%
100%
Mapped types used (not Column)
100%
100%
back_populates on all relationships
100%
100%
cascade='all, delete-orphan' on parent relationships
0%
100%
IntegrityError caught in add_product
71%
100%
Eager loading in get_product_detail
0%
100%
select() API used (not db.query)
0%
100%
pool_pre_ping enabled
0%
100%
Session yield/finally cleanup
100%
100%
Foreign key columns indexed
0%
100%
ondelete='CASCADE' on ForeignKeys
0%
100%
expire_on_commit=False
0%
100%
pool_pre_ping enabled
0%
100%
Pool size and overflow configured
0%
100%
Database URL from environment variable
75%
100%
expire_on_commit=False on sessionmaker
0%
100%
Session uses yield with finally for cleanup
100%
100%
DeclarativeBase used (not declarative_base)
100%
100%
Mapped types used (not Column)
100%
100%
Eager loading on get_user_with_orders
100%
100%
cascade='all, delete-orphan' on User.orders
0%
100%
ondelete='CASCADE' on ForeignKey
0%
100%
back_populates used (not backref)
100%
100%
Foreign key columns indexed
0%
100%