Changes between Version 22 and Version 23 of NonSqlBackends
- Timestamp:
- Aug 30, 2009, 7:39:24 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NonSqlBackends
v22 v23 12 12 Database query operations (get, count, ... entities) are provided to Django models via managers. Managers basically wrap around QuerySet methods. Internally Django's QuerySet class uses sql.Query whose default is sql.BaseQuery. sql.Query can be overridden to use a custom Query class (the backend). So we end up writting a Query class in order to provide a specific backend. So anything done in Django's Model methods or QuerySet methods which cannot be done for a specific backend should be moved into the Query in order to allow backends to specify what to do in such cases. 13 13 Additionally the backends Query class should not be referenced by sql.Query (cause it can have nothing to do with sql) 14 15 == Emulation of SQL features == 16 17 If we emulate certain SQL features, it must be possible to detect when something gets emulated. This is important because you might mistakenly develop code that doesn't scale when your database grows beyond a certain size. In settings.py we could have a flag which specifies whether to throw warnings for emulated features (ENABLE_DB_EMULATION_WARNINGS?). By default, warnings should be enabled, so you never miss potential sources of problems. 14 18 15 19 = sql.subqueries =