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 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
16
19
- Compatible with
@@ -273,12 +276,42 @@ The following features are currently not fully supported:
273
276
- Date extract function
274
277
- Bulk insert into a table with a trigger and returning the rows inserted
275
278
279
+
### Django 5.1 Specific Limitations
280
+
281
+
Django 5.1 introduces composite primary key support which has limited compatibility with SQL Server:
282
+
-**inspectdb command**: Cannot properly inspect tables with composite primary keys
283
+
-**Backend debugging**: SQL execution wrapper debug functionality may not work correctly
284
+
-**Schema operations**: Some field unique constraint removal operations may have issues
285
+
- Most other Django 5.1 features work correctly with SQL Server
286
+
276
287
### Django 5.2 Specific Limitations
277
288
278
-
Django 5.2 introduces some new features that require SQL Server-specific implementations:
279
-
- Tuple lookups (e.g., `(col1, col2) IN (...)`) are not supported by SQL Server and need conversion to individual column comparisons
280
-
- Complex aggregation queries with filtered references may need optimization for SQL Server
281
-
- These limitations are documented in the test exclusions and are good candidates for community contributions
289
+
Django 5.2 introduces new features that may cause regressions for existing Django 5.0+ applications. The following features have known limitations when upgrading to Django 5.2:
290
+
291
+
**Critical Limitations (May Affect Common Use Cases):**
292
+
-**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
293
+
-**Multi-column foreign key relationships**: Complex queries involving foreign keys with multiple columns may fail in Django 5.2 due to tuple lookup generation
294
+
-**JSONField with special characters**: JSONField lookups involving special characters (quotes, emojis, escape sequences) may generate invalid SQL
295
+
-**JSONField bulk updates**: Bulk update operations on JSONField with null handling may fail
296
+
297
+
**Moderate Impact:**
298
+
-**Complex aggregations**: Some aggregation queries with filtered references and subqueries may not work correctly
299
+
-**Prefetch operations**: `prefetch_related()` operations on multi-column foreign keys may fail
300
+
-**Migration data persistence**: Issues with migration data persistence tests involving table names with spaces
-`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.
282
315
283
316
JSONField lookups have limitations, more details [here](https://github.com/microsoft/mssql-django/wiki/JSONField).
0 commit comments