I need to migrate an insanely large code base that extensively uses SQLAlchemy 1.4 to 2.0. I am sure there is something I can do to automate or simplify at least a piece of this task, but I haven't found anything quite helpful or effective.

SQLAlchemy's Major Migration Guide tells you the basic and advanced stuff, and it is an important reading, but it is really not a practical guide. To amke matters worse, the `SQLALCHEMY_WARN_20=1` seems to have no effect on my current test suite.

I've tried creating scripts with AST to refactor pieces of code, I've tried using Claude Code to make tests only then updating functions and I've tried using GitHub Copilot with Claude Sonnet 4.5. None of this seemed to be able to chip away a considerable portion of the problem while at least seeming reliable.

I am totally willing to pay attention to AI made or programatically made changes, and review them carefully, but I don't expect to be able to create years of technical debt worth of tests, nor to hand create all changes and send them to PR reviews.

Are there any tools, method or scripts that can at least automate a part of this work reliably as of 2025?

0

Your Reply

By clicking “Post Your Reply”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.