mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #29934 -- Added sqlparse as a require dependency.
This commit is contained in:
@@ -194,10 +194,6 @@ class BaseDatabaseFeatures:
|
||||
# Does 'a' LIKE 'A' match?
|
||||
has_case_insensitive_like = True
|
||||
|
||||
# Does the backend require the sqlparse library for splitting multi-line
|
||||
# statements before executing them?
|
||||
requires_sqlparse_for_splitting = True
|
||||
|
||||
# Suffix for backends that don't support "SELECT xxx;" queries.
|
||||
bare_select_suffix = ''
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@ import datetime
|
||||
import decimal
|
||||
from importlib import import_module
|
||||
|
||||
import sqlparse
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.db import NotSupportedError, transaction
|
||||
from django.db.backends import utils
|
||||
from django.utils import timezone
|
||||
@@ -298,16 +299,10 @@ class BaseDatabaseOperations:
|
||||
cursor.execute() call and PEP 249 doesn't talk about this use case,
|
||||
the default implementation is conservative.
|
||||
"""
|
||||
try:
|
||||
import sqlparse
|
||||
except ImportError:
|
||||
raise ImproperlyConfigured(
|
||||
"The sqlparse package is required if you don't split your SQL "
|
||||
"statements manually."
|
||||
)
|
||||
else:
|
||||
return [sqlparse.format(statement, strip_comments=True)
|
||||
for statement in sqlparse.split(sql) if statement]
|
||||
return [
|
||||
sqlparse.format(statement, strip_comments=True)
|
||||
for statement in sqlparse.split(sql) if statement
|
||||
]
|
||||
|
||||
def process_clob(self, value):
|
||||
"""
|
||||
|
||||
@@ -26,7 +26,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
||||
nulls_order_largest = True
|
||||
closed_cursor_error_class = InterfaceError
|
||||
has_case_insensitive_like = False
|
||||
requires_sqlparse_for_splitting = False
|
||||
greatest_least_ignores_nulls = True
|
||||
can_clone_databases = True
|
||||
supports_temporal_subtraction = True
|
||||
|
||||
Reference in New Issue
Block a user