summaryrefslogtreecommitdiff
path: root/django/db/backends/oracle/client.py
blob: 52c4880e0efeaeaa7021c513c83de50f7f250219 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.db.backends import BaseDatabaseClient
from django.conf import settings
import os

class DatabaseClient(BaseDatabaseClient):
    executable_name = 'sqlplus'

    def runshell(self):
        dsn = settings.DATABASE_USER
        if settings.DATABASE_PASSWORD:
            dsn += "/%s" % settings.DATABASE_PASSWORD
        if settings.DATABASE_NAME:
            dsn += "@%s" % settings.DATABASE_NAME
        args = [self.executable_name, "-L", dsn]
        os.execvp(self.executable_name, args)