Vincent Warmerdam 11/25/2025

Banning SQLAlchemy Dialects with Ruff

Read Original

This article explains how to configure the Ruff linter to ban SQLAlchemy dialect-specific imports (e.g., from sqlalchemy.dialects.sqlite) in a Python codebase. This enforces the use of portable SQLAlchemy types, maintaining compatibility across different database backends like PostgreSQL, MySQL, and SQLite, which is crucial for libraries or larger systems.

Banning SQLAlchemy Dialects with Ruff

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week