Code

Ticket #5122: dbprompt.diff

File dbprompt.diff, 1009 bytes (added by cmgreen@…, 7 years ago)

New version of same patch

Line 
1Index: /usr/local/src/django/django/db/backends/mysql/client.py
2===================================================================
3--- /usr/local/src/django/django/db/backends/mysql/client.py    (revision 5830)
4+++ /usr/local/src/django/django/db/backends/mysql/client.py    (working copy)
5@@ -8,6 +8,10 @@
6     passwd = settings.DATABASE_OPTIONS.get('passwd', settings.DATABASE_PASSWORD)
7     host = settings.DATABASE_OPTIONS.get('host', settings.DATABASE_HOST)
8     port = settings.DATABASE_OPTIONS.get('port', settings.DATABASE_PORT)
9+    if settings.DATABASE_PROMPT:
10+        prompt = settings.DATABASE_PROMPT
11+    else:
12+        prompt = None
13     defaults_file = settings.DATABASE_OPTIONS.get('read_default_file')
14     # Seems to be no good way to set sql_mode with CLI
15     
16@@ -21,6 +25,8 @@
17         args += ["--host=%s" % host]
18     if port:
19         args += ["--port=%s" % port]
20+    if prompt:
21+        args += ["--prompt=%s" % prompt]
22     if db:
23         args += [db]
24