mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #29534 -- Made dbshell use rlwrap on Oracle if available.
This commit is contained in:
committed by
Tim Graham
parent
9a88c6dd6a
commit
c6525bea9e
@@ -1,3 +1,4 @@
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from django.db.backends.base.client import BaseDatabaseClient
|
||||
@@ -5,8 +6,12 @@ from django.db.backends.base.client import BaseDatabaseClient
|
||||
|
||||
class DatabaseClient(BaseDatabaseClient):
|
||||
executable_name = 'sqlplus'
|
||||
wrapper_name = 'rlwrap'
|
||||
|
||||
def runshell(self):
|
||||
conn_string = self.connection._connect_string()
|
||||
args = [self.executable_name, "-L", conn_string]
|
||||
wrapper_path = shutil.which(self.wrapper_name)
|
||||
if wrapper_path:
|
||||
args = [wrapper_path, *args]
|
||||
subprocess.check_call(args)
|
||||
|
||||
Reference in New Issue
Block a user