You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Django 5.0 and below**: Full production support
15
+
-**Django 5.1**: Supported with minor limitations (composite primary key inspectdb)
16
+
-**Django 5.2**: Supported with enhanced SQL Server compatibility features and documented limitations (see Django 5.2 Specific Limitations section below)
14
17
- Tested on Microsoft SQL Server 2016, 2017, 2019, 2022
15
18
- Passes most of the tests of the Django test suite
19
+
- Enhanced SQL Server compatibility with automatic schema creation and improved identifier quoting
16
20
- Compatible with
17
21
[Micosoft ODBC Driver for SQL Server](https://docs.microsoft.com/en-us/sql/connect/odbc/microsoft-odbc-driver-for-sql-server),
18
22
[SQL Server Native Client](https://msdn.microsoft.com/en-us/library/ms131321(v=sql.120).aspx),
@@ -273,6 +277,42 @@ The following features are currently not fully supported:
273
277
- Date extract function
274
278
- Bulk insert into a table with a trigger and returning the rows inserted
275
279
280
+
### Django 5.1 Specific Limitations
281
+
282
+
Django 5.1 introduces composite primary key support which has limited compatibility with SQL Server:
283
+
-**inspectdb command**: Cannot properly inspect tables with composite primary keys
284
+
-**Backend debugging**: SQL execution wrapper debug functionality may not work correctly
285
+
-**Schema operations**: Some field unique constraint removal operations may have issues
286
+
- Most other Django 5.1 features work correctly with SQL Server
287
+
288
+
### Django 5.2 Specific Limitations
289
+
290
+
Django 5.2 introduces new features that may cause regressions for existing Django 5.0+ applications. This release includes enhanced SQL Server compatibility for Django 5.2, with automatic schema creation and improved identifier quoting. The following limitations remain:
291
+
292
+
**Critical Limitations (May Affect Common Use Cases):**
293
+
-**Tuple lookups**: Queries like `Model.objects.filter((col1, col2)__in=[(val1, val2)])` will fail with SQL syntax errors as SQL Server doesn't support `(col1, col2) IN (...)` syntax
294
+
-**Multi-column foreign key relationships**: Complex queries involving foreign keys with multiple columns may fail in Django 5.2 due to tuple lookup generation
295
+
-**JSONField with special characters**: JSONField lookups involving special characters (quotes, emojis, escape sequences) may generate invalid SQL
296
+
-**JSONField bulk updates**: Bulk update operations on JSONField with null handling may fail
297
+
298
+
**Moderate Impact:**
299
+
-**Complex aggregations**: Some aggregation queries with filtered references and subqueries may not work correctly
300
+
-**Prefetch operations**: `prefetch_related()` operations on multi-column foreign keys may fail
-`queries.test_bulk_update.BulkUpdateTests.test_json_field_sql_null` test
312
+
- Various migration and backend debugging tests
313
+
314
+
**Workaround**: These limitations are documented in the test exclusions (`testapp/settings.py`) and are excellent candidates for community contributions. Applications using Django 5.0 and below are unaffected by these limitations.
315
+
276
316
JSONField lookups have limitations, more details [here](https://github.com/microsoft/mssql-django/wiki/JSONField).
0 commit comments