mirror of https://github.com/sgoudham/Enso-Bot.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
499 B
Python
18 lines
499 B
Python
5 years ago
|
import shutil
|
||
|
import subprocess
|
||
|
|
||
|
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.run(args, check=True)
|