You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

features.py 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. from django.db.backends.base.features import BaseDatabaseFeatures
  2. from django.db.utils import InterfaceError
  3. from django.utils.functional import cached_property
  4. class DatabaseFeatures(BaseDatabaseFeatures):
  5. interprets_empty_strings_as_nulls = True
  6. has_select_for_update = True
  7. has_select_for_update_nowait = True
  8. has_select_for_update_skip_locked = True
  9. has_select_for_update_of = True
  10. select_for_update_of_column = True
  11. can_return_id_from_insert = True
  12. can_introspect_autofield = True
  13. supports_subqueries_in_group_by = False
  14. supports_transactions = True
  15. supports_timezones = False
  16. has_native_duration_field = True
  17. can_defer_constraint_checks = True
  18. supports_partially_nullable_unique_constraints = False
  19. truncates_names = True
  20. supports_tablespaces = True
  21. supports_sequence_reset = False
  22. can_introspect_materialized_views = True
  23. can_introspect_time_field = False
  24. atomic_transactions = False
  25. supports_combined_alters = False
  26. nulls_order_largest = True
  27. requires_literal_defaults = True
  28. closed_cursor_error_class = InterfaceError
  29. bare_select_suffix = " FROM DUAL"
  30. # select for update with limit can be achieved on Oracle, but not with the current backend.
  31. supports_select_for_update_with_limit = False
  32. supports_temporal_subtraction = True
  33. # Oracle doesn't ignore quoted identifiers case but the current backend
  34. # does by uppercasing all identifiers.
  35. ignores_table_name_case = True
  36. supports_index_on_text_field = False
  37. has_case_insensitive_like = False
  38. create_test_procedure_without_params_sql = """
  39. CREATE PROCEDURE "TEST_PROCEDURE" AS
  40. V_I INTEGER;
  41. BEGIN
  42. V_I := 1;
  43. END;
  44. """
  45. create_test_procedure_with_int_param_sql = """
  46. CREATE PROCEDURE "TEST_PROCEDURE" (P_I INTEGER) AS
  47. V_I INTEGER;
  48. BEGIN
  49. V_I := P_I;
  50. END;
  51. """
  52. supports_callproc_kwargs = True
  53. supports_over_clause = True
  54. supports_ignore_conflicts = False
  55. max_query_params = 2**16 - 1
  56. supports_partial_indexes = False
  57. allows_multiple_constraints_on_same_fields = False
  58. @cached_property
  59. def has_fetch_offset_support(self):
  60. return self.connection.oracle_version >= (12, 2)
  61. @cached_property
  62. def allow_sliced_subqueries_with_in(self):
  63. return self.has_fetch_offset_support
  64. @cached_property
  65. def supports_slicing_ordering_in_compound(self):
  66. return self.has_fetch_offset_support