CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/sqlalchemy-best-practices

SQLAlchemy patterns — engine setup, session management, declarative models,

98

1.96x
Quality

99%

Does it follow best practices?

Impact

98%

1.96x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

Evaluation results

92%

22%

Async Notification Service

Criteria
Without context
With context

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%

100%

54%

Blog Platform Database Layer

Criteria
Without context
With context

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%

100%

51%

Bulk Product Import Service

Criteria
Without context
With context

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%

100%

64%

Inventory Management API

Criteria
Without context
With context

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%

100%

51%

User Orders Service

Criteria
Without context
With context

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%

Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents