You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

client.py 494B

1234567891011121314151617
  1. import shutil
  2. import subprocess
  3. from django.db.backends.base.client import BaseDatabaseClient
  4. class DatabaseClient(BaseDatabaseClient):
  5. executable_name = 'sqlplus'
  6. wrapper_name = 'rlwrap'
  7. def runshell(self):
  8. conn_string = self.connection._connect_string()
  9. args = [self.executable_name, "-L", conn_string]
  10. wrapper_path = shutil.which(self.wrapper_name)
  11. if wrapper_path:
  12. args = [wrapper_path, *args]
  13. subprocess.check_call(args)