#36420: Use actual SQLite limits in last_executed_query() -------------------------------------+------------------------------------- Reporter: Adam Johnson | Type: | Cleanup/optimization Status: new | Component: Database | layer (models, ORM) Version: dev | Severity: Normal Keywords: | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- The SQLite backend’s `last_executed_query()` method does its own parameter batching: https://github.com/django/django/blob/b373721af0e5c3de0986977ac07e3ad55061ecbe/django/db/backends/sqlite3/operations.py#L154-L179
The comment there from Aymeric notes that “Since Python's sqlite3 module doesn't expose the get_limit() C API, assume the default limits are in effect...”. Python 3.11 added the `getlimit()` function, which exposes that API: https://docs.python.org/3.13/library/sqlite3.html#sqlite3.Connection.getlimit . We already have use for it in #36143. That method could be updated to use the actual limits and accurately reflect the queries that were executed. -- Ticket URL: <https://code.djangoproject.com/ticket/36420> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/django-updates/010701970d13ba92-ded41156-92c0-42f9-b311-8c24a2ee2362-000000%40eu-central-1.amazonses.com.