Skip to content

Conversation

@DiaaNoon
Copy link

@DiaaNoon DiaaNoon commented Jan 27, 2026

Summary

  • Add support for SQLAlchemy 2.0's unified execute() API
  • SQLAlchemy 2.0 no longer accepts **kwargs for Connection.execute(), requires dict instead
  • Uses packaging library for robust version detection (PEP 440 compliant)
  • Raises clear TypeError if Engine is passed directly (Engine.execute() was removed in 2.0)

Changes

  • Detect SQLAlchemy version at import time using packaging.version
  • For SQLAlchemy >= 2.0: pass params as dict, error if Engine passed
  • For SQLAlchemy < 2.0: preserve existing behavior (Session uses params=, Connection uses **kwargs)
  • Added packaging as dependency

SQLAlchemy 2.0 unified the execute() API - Connection.execute() no longer
accepts **kwargs, requiring parameters as a dict instead.

Uses packaging library for robust version detection.
@DiaaNoon DiaaNoon force-pushed the feature-sqlalchemy-2-support branch from 984e16a to fe6aa56 Compare January 27, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant