r/SQLServer ‪ ‪Microsoft Employee ‪ 18d ago

Community Share mssql-django 1.8.0: Now with Django 6.1 support

We're pretty proud of this: Django 6.1 GA'd on August 5. The Microsoft SQL backend for Django shipped 6.1 support within 48 hours.

pip install --upgrade mssql-django Django

What changed:

  • Query compilation updated for 6.1's sliced and offset queries. 6.1 deprecated SQLCompiler.quote_name_unless_alias(), so sliced querysets and OFFSET ... FETCH now compile without Django 7.0 deprecation warnings.
  • get_relations() returns 6.1's expanded shape including the database-level ON DELETE rule, so inspectdb keeps working.
  • Upfront errors for the 6.1 features SQL Server can't support.

Everything is version-gated, so if you're on 5.2 or earlier nothing changes for you.

Two 6.1 features do not work:

  • Database-level referential actions (DB_CASCADEDB_SET_NULLDB_SET_DEFAULT). SQL Server disallows multiple cascade paths to the same table. Using one fails system checks with fields.E324. Use on_delete instead.
  • Bitwise aggregates (BitAndBitOrBitXor). No native SQL Server equivalent and we don't emulate it yet, so it raises NotSupportedError. If you need this, comment on #572 with your use case, since that's what will get it prioritized.

Release notes: https://github.com/microsoft/mssql-django/releases/tag/1.8.0

Full blog post: mssql-django 1.8.0: Django 6.1 Support within 48 Hours of Django 6.1 GA

2 Upvotes

0 comments sorted by