|
1 | 1 | import contextlib
|
2 |
| -import copy |
3 | 2 | import os
|
4 | 3 |
|
5 | 4 | from django.core.exceptions import ImproperlyConfigured
|
6 | 5 | from django.db import DEFAULT_DB_ALIAS
|
7 |
| -from django.db.backends.base.base import NO_DB_ALIAS, BaseDatabaseWrapper |
| 6 | +from django.db.backends.base.base import BaseDatabaseWrapper |
8 | 7 | from django.db.backends.utils import debug_transaction
|
9 | 8 | from django.utils.asyncio import async_unsafe
|
10 | 9 | from django.utils.functional import cached_property
|
@@ -157,10 +156,6 @@ def _isnull_operator(a, b):
|
157 | 156 | def __init__(self, settings_dict, alias=DEFAULT_DB_ALIAS):
|
158 | 157 | super().__init__(settings_dict, alias=alias)
|
159 | 158 | self.session = None
|
160 |
| - # Cache the `settings_dict` in case we need to check for |
161 |
| - # auto_encryption_opts later. |
162 |
| - self.__dict__["_settings_dict"] = copy.deepcopy(settings_dict) |
163 |
| - self.encrypted_connection = None |
164 | 159 |
|
165 | 160 | def get_collection(self, name, **kwargs):
|
166 | 161 | collection = Collection(self.database, name, **kwargs)
|
@@ -291,26 +286,6 @@ def validate_no_broken_transaction(self):
|
291 | 286 |
|
292 | 287 | def get_database_version(self):
|
293 | 288 | """Return a tuple of the database's version."""
|
294 |
| - return tuple(self.connection.server_info()["versionArray"]) |
295 |
| - |
296 |
| - @contextlib.contextmanager |
297 |
| - def _nodb_cursor(self): |
298 |
| - """ |
299 |
| - Returns a cursor from an unencrypted connection for operations |
300 |
| - that do not support encryption. |
301 |
| -
|
302 |
| - Encryption is only supported on encrypted models. |
303 |
| - """ |
304 |
| - |
305 |
| - # Remove auto_encryption_opts from OPTIONS |
306 |
| - if self.settings_dict.get("OPTIONS", {}).get("auto_encryption_opts"): |
307 |
| - self.settings_dict["OPTIONS"].pop("auto_encryption_opts") |
308 |
| - |
309 |
| - # Create a new connection without OPTIONS["auto_encryption_opts": …] |
310 |
| - conn = self.__class__({**self.settings_dict}, alias=NO_DB_ALIAS) |
311 |
| - |
312 |
| - try: |
313 |
| - with conn.cursor() as cursor: |
314 |
| - yield cursor |
315 |
| - finally: |
316 |
| - conn.close() |
| 289 | + return (8, 1, 1) |
| 290 | + # TODO: provide an unencrypted connection for this method. |
| 291 | + # return tuple(self.connection.server_info()["versionArray"]) |
0 commit comments