diff options
| author | Simon Charette <charette.s@gmail.com> | 2020-10-04 18:25:29 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-10-29 22:22:58 +0100 |
| commit | bbe6fbb8768e8fb1aecb96d51c049d7ceaf802d3 (patch) | |
| tree | 7c0e7ac6defc405cd5320066f75ade21bf9943ac /django/db/backends/sqlite3 | |
| parent | 4ac2d4fa42e1659f328c35b6b8d4761b3419c11a (diff) | |
Refs #32061 -- Unified DatabaseClient.runshell() in db backends.
Diffstat (limited to 'django/db/backends/sqlite3')
| -rw-r--r-- | django/db/backends/sqlite3/client.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/django/db/backends/sqlite3/client.py b/django/db/backends/sqlite3/client.py index a71005fd5b..59a2fe7f50 100644 --- a/django/db/backends/sqlite3/client.py +++ b/django/db/backends/sqlite3/client.py @@ -1,15 +1,16 @@ -import subprocess - from django.db.backends.base.client import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'sqlite3' - def runshell(self, parameters): - # TODO: Remove str() when dropping support for PY37. - # args parameter accepts path-like objects on Windows since Python 3.8. - args = [self.executable_name, - str(self.connection.settings_dict['NAME'])] - args.extend(parameters) - subprocess.run(args, check=True) + @classmethod + def settings_to_cmd_args_env(cls, settings_dict, parameters): + args = [ + cls.executable_name, + # TODO: Remove str() when dropping support for PY37. args + # parameter accepts path-like objects on Windows since Python 3.8. + str(settings_dict['NAME']), + *parameters, + ] + return args, None |
