core.cache.backends.db does not work with 3rd party db backends that lack limit + offset
|Reported by:||manfre||Owned by:||akaariai|
|Component:||Database layer (models, ORM)||Version:||master|
|Severity:||Normal||Keywords:||cache, orm, database, backend|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The DatabaseCache must use raw SQL because it's not an app and doesn't have access to the ORM. Most of the raw SQL is standard SQL, except for a single query in _cull() that uses LIMIT + OFFSET. There is already special handling to support 'oracle' and similar, but different, handling is needed for django-mssql and most likely other 3rd party backends.
That attached patch adds DatabaseOperations.raw_limit_offset_select that is intended to allow a non-ORM way for database backends to provide a valid raw LIMIT + OFFSET query.
Change History (13)
comment:1 Changed 22 months ago by akaariai
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted