Skip to main content

One post tagged with "orm"

View All Tags

Using SQLAlchemy and pymssql with Babelfish 4.8.0 on FoundryDB

· 8 min read
FoundryDB Team
Engineering @ FoundryDB

Python developers working with SQL Server typically reach for one of two libraries: pymssql for direct TDS access, or SQLAlchemy for ORM-based workflows. Both work with Babelfish, but SQLAlchemy requires three specific workarounds due to differences in how Babelfish implements the TDS protocol.

This post covers both approaches with complete, working code tested against Babelfish 4.8.0 on PostgreSQL 16.11 running on FoundryDB staging. The pymssql section expands on driver-level coverage with additional tests for stored procedures and batch insert performance.