summaryrefslogtreecommitdiff
path: root/django/db/backends/__init__.py
AgeCommit message (Collapse)Author
2015-01-14Fixed #22603 -- Reorganized classes in django.db.backends.Tim Graham
2015-01-12Fixed #24031 -- Added CASE expressions to the ORM.Michał Modzelewski
2015-01-11Removed supports_binary_field flag as all backends support themClaude Paroz
It was mainly for MySQL on Python 3, but now the current recommended MySQL driver for Python 3 (mysqlclient) does support binary fields, it is unneeded. Refs #20377.
2015-01-08Fixed #24020 -- Refactored SQL compiler to use expressionsAnssi Kääriäinen
Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
2014-12-31Moved DatabaseCreation.data_types properties to DatabaseWrapper.Tim Graham
refs #22340.
2014-12-23Refs #2443 -- Move the durationfield converter logic.Marc Tamlyn
This reduces how frequently this logic is run significantly. Thanks to Anssi for the suggestion.
2014-12-23Fixed #24033 -- Use interval type on Oracle.Marc Tamlyn
Use INTERVAL DAY(9) TO SECOND(6) for Durationfield on Oracle rather than storing as a NUMBER(19) of microseconds. There are issues with cx_Oracle which require some extra data manipulation in the database backend when constructing queries, but it handles the conversion back to timedelta objects cleanly. Thanks to Shai for the review.
2014-12-20Fixed #2443 -- Added DurationField.Marc Tamlyn
A field for storing periods of time - modeled in Python by timedelta. It is stored in the native interval data type on PostgreSQL and as a bigint of microseconds on other backends. Also includes significant changes to the internals of time related maths in expressions, including the removal of DateModifierNode. Thanks to Tim and Josh in particular for reviews.
2014-12-12Fixed postgis test database initializationClaude Paroz
Refs #20968. Allow querying template_postgis presence without existing test database. Thanks Tim Graham for the review.
2014-12-12Fixed #23941 -- Removed implicit decimal formatting from expressions.Josh Smeaton
2014-12-08Fixed #20968 -- Checked Spatialite metadata before migrationsClaude Paroz
Thanks Kenial S. Lee for the initial patch and Tim Graham for the review.
2014-12-08Fixed #23968 -- Replaced list comprehension with generators and dict ↵Jon Dufresne
comprehension
2014-09-29Replaced set([foo, ...]) by {foo, ...} literals. Refs PR 3282.Thomas Chaumeny
Thanks Collin Anderson for the review.
2014-09-27Fixed #22738 -- made finer distinctions for when Boolean is not detected on ↵Shai Berger
Oracle Thanks Claude Paroz for partial fix and Simon Charrette for review
2014-09-26Fixed #22738 -- Abstracted boolean field type introspectionClaude Paroz
Thanks maxi for the report, Shai Berger for his help with the patch and Tim Graham for the review.
2014-09-26Factorized schema_editor() at BaseDatabaseWrapper levelClaude Paroz
2014-09-23Fixed #18782 -- Prevented sql_flush to flush viewsClaude Paroz
Thanks rodolfo_3 for the report and the initial patch, and Josh Smeaton, Shai Berger and Tim Graham for the reviews.
2014-09-23Made get_table_list return a TableInfo named tupleClaude Paroz
2014-09-05Limited lines to 119 characters in django/Tim Graham
refs #23395.
2014-09-03Fixed #18757, #14462, #21565 -- Reworked database-python type conversionsMarc Tamlyn
Complete rework of translating data values from database Deprecation of SubfieldBase, removal of resolve_columns and convert_values in favour of a more general converter based approach and public API Field.from_db_value(). Now works seamlessly with aggregation, .values() and raw queries. Thanks to akaariai in particular for extensive advice and inspiration, also to shaib, manfre and timograham for their reviews.
2014-08-19Replaced HAS_SPATIAL_DB by testing database featureClaude Paroz
Refs #22632. This should be the base for using more database features to exclude specific backends in GIS tests. Thanks Tim Graham for the review.
2014-08-06Fixed #21603 -- Fixed complex RawQuerySets queries on some versions of SQLite.Alex Hill
2014-08-05Fixed #23061: Avoided setting a limit on a query for get with ↵Shai Berger
select_for_update on Oracle Thanks Michael Miller for reporting the issue.
2014-07-28Fixed #23074 -- Avoided leaking savepoints in atomic.Aymeric Augustin
Thanks Chow Loong Jin for the report and the initial patch.
2014-07-26Fixed #22873 -- Renamed use_debug_cursor to force_debug_cursor to clarify ↵areski
the behavior.
2014-07-14Fixed name of database connection featureShai Berger
2014-06-23Fixed problem introduced with #refs 13711.Anubhav Joshi
2014-06-17Fixed #13711 -- Model check added to ensure that auto-generated column name ↵Anubhav Joshi
is within limits of the database. Thanks russellm for report and Tim Graham for review.
2014-06-16Renamed DatabaseFeature.supports_check_constraints to ↵Tim Graham
supports_column_check_constraints. Thanks maxi for the suggestion.
2014-06-14Fixed #22816 -- Corrected Oracle feature flag and fixed introspection testShai Berger
2014-06-09Fixed #20420 -- Normalized query counts on Oracle.Aymeric Augustin
This is achieved by inserting a fake entry in connection.queries when not releasing a savepoint (since Oracle doesn't support that operation.) Also removed the can_release_savepoints feature that was recently added, but is superseded by this solution.
2014-06-09Simplified handling of use_debug_cursor.Aymeric Augustin
Turned it from a tri-valued boolean into a regular boolean.
2014-06-07Fixed #17427 -- Removed dubious definition of connections equality.Aymeric Augustin
2014-06-07Fixed #3711, #6734, #12581 -- Bounded connection.queries.Aymeric Augustin
Prevented unlimited memory consumption when running background tasks with DEBUG=True. Thanks Rob, Alex, Baptiste, and others.
2014-06-06Replaced an explicit vendor check by a feature flag.Aymeric Augustin
Forward-port of c9aedce0 from stable/1.7.x.
2014-06-05Added a flag for the ability to introspect nullable fields.Aymeric Augustin
Previously this was conflated with another Oracle-specific behavior.
2014-05-28Set straight the sense of 'uppercases_column_names' feature flagShai Berger
2014-05-20Add feature for implied null (needed for Firebird backend)Andrew Godwin
2014-05-15Fixed #20897 -- Added make_cursor() for consistent cursor creationTim Martin
In django.db.backends.BaseDatabaseWrapper, pulled the creation of cursors in the non-debug case into a separate method, in order to make behavior more consistent when overriding the cursor creation in derived classes.
2014-05-10Adjusted refactoring of vendor checks.Aymeric Augustin
Thanks Shai for the thorough review.
2014-05-08Added feature flags for introspection capabilities.Aymeric Augustin
2014-05-08Split ignores_nulls_in_unique_constraints feature.Aymeric Augustin
Oracle and SQL Server don't have exactly the same limitations. It's worth treating them differently.
2014-05-08Replaced vendor checks by three feature flags.Aymeric Augustin
2014-04-26Fix many many typos in comments throughout the codebaseAlex Gaynor
2014-04-26Fixed #3214 -- Stopped parsing SQL with regex.Aymeric Augustin
Avoided introducing a new regex-based SQL splitter in the migrations framework, before we're bound by backwards compatibility. Adapted this change to the legacy "initial SQL data" feature, even though it's already deprecated, in order to facilitate the transition to migrations. sqlparse becomes mandatory for RunSQL on some databases (all but PostgreSQL). There's no API to provide a single statement and tell Django not to attempt splitting. Since we have a more robust splitting implementation, that seems like a good tradeoff. It's easier to add a new keyword argument later if necessary than to remove one. Many people contributed to both tickets, thank you all, and especially Claude for the review. Refs #22401.
2014-04-25Fixed #21166 -- Reset errors_occurred flag after commit and rollback.Aymeric Augustin
2014-04-24Ignored repeated calls to connection.close().Aymeric Augustin
Forwardport of 9bbb43dd1a from stable/1.7.x
2014-04-10Fixed #21239 -- Maintained atomicity when closing the connection.Aymeric Augustin
Refs #15802 -- Reverted #7c657b24 as BaseDatabaseWrapper.close() now has a proper "finally" clause that may need to preserve self.connection.
2014-04-09Fixed #21553 -- Ensured unusable database connections get closed.Aymeric Augustin
2014-03-25Fixed #12030 -- Validate integer field range at the model level.Simon Charette
Thanks to @timgraham for the review.