Kaydet (Commit) 0d6b7e4a authored tarafından Milan Broum's avatar Milan Broum Kaydeden (comit) Tim Graham

[1.8.x] Allowed using the sqlite3 backend as much as possible without _sqlite3.

The inner import was dropped during the reorganizing of the database
backends in commit 28308078.

Backport of 95058606 from master
üst efb98604
import _sqlite3 # isort:skip
import codecs import codecs
import copy import copy
from decimal import Decimal from decimal import Decimal
...@@ -14,6 +13,10 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): ...@@ -14,6 +13,10 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_inline_fk = "REFERENCES %(to_table)s (%(to_column)s)" sql_create_inline_fk = "REFERENCES %(to_table)s (%(to_column)s)"
def quote_value(self, value): def quote_value(self, value):
# The backend "mostly works" without this function and there are use
# cases for compiling Python without the sqlite3 libraries (e.g.
# security hardening).
import _sqlite3
try: try:
value = _sqlite3.adapt(value) value = _sqlite3.adapt(value)
except _sqlite3.ProgrammingError: except _sqlite3.ProgrammingError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment