September 16, 2026

Python Workers can now connect to PostgreSQL and MySQL through Hyperdrive.

Hyperdrive support in Python Workers uses TCP socket support to establish database connections. While any Python driver that works with TCP connections can be used, Cloudflare recommends drivers such as asyncpg and aiomysql that have been tested and verified to work with Hyperdrive.

To use Hyperdrive in Python Workers, developers must set compatibility_date to 2026-09-08 or later and add a Hyperdrive binding in the Wrangler configuration. Hyperdrive support in Python Workers is currently in beta.

Currently, only synchronous SQLAlchemy ORMs are supported in Python Workers. Async SQLAlchemy ORMs are not yet supported due to a lack of greenlet support in the Python Workers environment.